|
@@ -1,12 +1,11 @@
|
|
# -*- coding: utf-8 -*-
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
"""
|
|
-Created on 2023-7-10
|
|
|
|
|
|
+Created on 2024-12-02
|
|
---------
|
|
---------
|
|
@summary: 中国交建物资采购管理信息系统
|
|
@summary: 中国交建物资采购管理信息系统
|
|
---------
|
|
---------
|
|
@author: lzz
|
|
@author: lzz
|
|
"""
|
|
"""
|
|
-
|
|
|
|
import feapder
|
|
import feapder
|
|
from items.spider_item import MgpListItem
|
|
from items.spider_item import MgpListItem
|
|
from collections import namedtuple
|
|
from collections import namedtuple
|
|
@@ -22,21 +21,21 @@ class Feapder(feapder.BiddingListSpider):
|
|
self.site = "中国交建物资采购管理信息系统"
|
|
self.site = "中国交建物资采购管理信息系统"
|
|
|
|
|
|
self.menus = [
|
|
self.menus = [
|
|
- Menu('流标公告', 'a_zgjjwzcgglxxxt_lbgg', 1),
|
|
|
|
|
|
+ Menu('流标公告', 'a_zgjjwzcgglxxxt_lbgg', 2),
|
|
]
|
|
]
|
|
|
|
|
|
self.headers = {
|
|
self.headers = {
|
|
- "APP_TOKEN": "",
|
|
|
|
|
|
+ "APP_TOKEN;": "",
|
|
"Accept": "application/json, text/plain, */*",
|
|
"Accept": "application/json, text/plain, */*",
|
|
- "Accept-Language": "zh-CN,zh;q=0.9",
|
|
|
|
- "Authorization": "",
|
|
|
|
|
|
+ "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
|
|
|
|
+ "Authorization;": "",
|
|
"Cache-Control": "no-cache",
|
|
"Cache-Control": "no-cache",
|
|
"Connection": "keep-alive",
|
|
"Connection": "keep-alive",
|
|
"Content-Type": "application/json;charset=UTF-8",
|
|
"Content-Type": "application/json;charset=UTF-8",
|
|
"Origin": "https://sp.iccec.cn",
|
|
"Origin": "https://sp.iccec.cn",
|
|
"Pragma": "no-cache",
|
|
"Pragma": "no-cache",
|
|
"Referer": "https://sp.iccec.cn/announcementsList?type=8&source=1",
|
|
"Referer": "https://sp.iccec.cn/announcementsList?type=8&source=1",
|
|
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
|
|
|
|
|
|
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
|
|
}
|
|
}
|
|
|
|
|
|
self.cookies = {
|
|
self.cookies = {
|
|
@@ -46,7 +45,7 @@ class Feapder(feapder.BiddingListSpider):
|
|
def start_requests(self):
|
|
def start_requests(self):
|
|
for menu in self.menus:
|
|
for menu in self.menus:
|
|
start_url = "https://sp.iccec.cn/apis/sp/bidc/users/signup/listSupBidNotice"
|
|
start_url = "https://sp.iccec.cn/apis/sp/bidc/users/signup/listSupBidNotice"
|
|
- yield feapder.Request(url=start_url, item=menu._asdict(), page=1, proxies=False)
|
|
|
|
|
|
+ yield feapder.Request(url=start_url, item=menu._asdict(), page=1)
|
|
|
|
|
|
def download_midware(self, request):
|
|
def download_midware(self, request):
|
|
page = request.page
|
|
page = request.page
|
|
@@ -94,7 +93,7 @@ class Feapder(feapder.BiddingListSpider):
|
|
list_item.city = city # 城市 默认为空
|
|
list_item.city = city # 城市 默认为空
|
|
|
|
|
|
list_item.unique_key = ('href',)
|
|
list_item.unique_key = ('href',)
|
|
- list_item.parse = "self.detail_json" # 详情页回调方法
|
|
|
|
|
|
+ list_item.parse = "self.detail_get" # 详情页回调方法
|
|
|
|
|
|
ddata = {
|
|
ddata = {
|
|
"schemeId": schemeId,
|
|
"schemeId": schemeId,
|
|
@@ -107,10 +106,6 @@ class Feapder(feapder.BiddingListSpider):
|
|
"headers":self.headers,
|
|
"headers":self.headers,
|
|
"cookies":self.cookies}
|
|
"cookies":self.cookies}
|
|
|
|
|
|
- list_item.deal_detail = '''
|
|
|
|
-html = response.json.get('data').get('textInfo')
|
|
|
|
-list_item.contenthtml = html
|
|
|
|
- '''
|
|
|
|
list_item.proxies = False
|
|
list_item.proxies = False
|
|
list_item.parse_url = "https://sp.iccec.cn/apis/sp/bidc/users/signup/qryNoticeDetail" # 详情页请求地址
|
|
list_item.parse_url = "https://sp.iccec.cn/apis/sp/bidc/users/signup/qryNoticeDetail" # 详情页请求地址
|
|
|
|
|
|
@@ -123,4 +118,4 @@ list_item.contenthtml = html
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|
|
- Feapder(redis_key="detail:normal_details", user="106").start()
|
|
|
|
|
|
+ Feapder(redis_key="lzz:zgjjwzcgglxxxt_qbjg").start()
|