我们都知道 在requests中可以使用 requests.get(url,params)的方式传值
那么在scrapy中如何传值呢
直接看代码
from urllib.parse import urlencode
params = {
'wbtreeid': '5571',
'searchtext': '',
'wsbslistCURURI': 'ED1C87781DBB6EE748D288AAF4957433',
'wsbslistKEYTYPES': '4,4,4,12,12,93',
'actiontype': '',
'wsbslistORDER': 'desc',
'wsbslistORDERKEY': 'wbdate',
'wsbslistCountNo': '20',
'wsbslistNOWPAGE': str(num),
'wsbslistPAGE': '0',
'wsbslistrowCount': '3545'
}
url = "https://zwfw.nx.gov.cn/jfpt/newslist_ycs.jsp?" + urlencode(params)
标签:urlencode,12,get,Scrapy,params,传值
From: https://www.cnblogs.com/zichliang/p/16730537.html