瀏覽代碼

停用付费代理,更新请求时间参数

dongzhaorui 1 年之前
父節點
當前提交
e3f1c93894
共有 1 個文件被更改,包括 10 次插入5 次删除
  1. 10 5
      zgztb_cookie/zgzbtb_spider_m.py

+ 10 - 5
zgztb_cookie/zgzbtb_spider_m.py

@@ -2,7 +2,7 @@
 """
 Created on 2023-08-11
 ---------
-@summary: 中国招标投标公共服务平台-列表页(付费代理)
+@summary: 中国招标投标公共服务平台-列表页(付费代理停用
 ---------
 @author: dzr
 """
@@ -11,6 +11,7 @@ from collections import namedtuple
 import feapder
 import feapder.utils.tools as tools
 from feapder import Item
+from feapder.network.proxy_pool import swordfish_proxy
 from feapder.network.request import requests
 from feapder.utils.log import log as logger
 from feapder.utils.tools import json
@@ -30,7 +31,7 @@ class ListPageSpider(feapder.AirSpider):
 
     @property
     def proxy(self):
-        return pay_proxy()
+        return swordfish_proxy()
 
     @staticmethod
     def extract_address(region):
@@ -63,8 +64,6 @@ class ListPageSpider(feapder.AirSpider):
         ]
         start_time = '2天'
         page_size = 1000
-        # today = datetime.date.today()
-        # end_day = today - datetime.timedelta(days=-3)
         for menu in task_menus:
             business_type = menu.type
             for page in range(1, 2):
@@ -77,12 +76,18 @@ class ListPageSpider(feapder.AirSpider):
                     'searchTimeStart': '',
                     'searchTimeStop': '',
                     'timeTypeParam': '',
-                    'bulletinIssnTime': start_time,
+                    'bulletinIssnTime': '',
                     'bulletinIssnTimeStart': '',
                     'bulletinIssnTimeStop': '',
                     'pageNo': page,
                     'row': page_size,
                 }
+
+                if business_type in ['开标记录', '评标公示', '中标公告']:
+                    data['timeTypeParam'] = start_time
+                else:
+                    data['bulletinIssnTime'] = start_time
+
                 meta = {
                     'msg': f'{business_type}-第{page}页',
                     'interval': 1,  # 切换代理间隔时长