loery_chen 发表于 2019-8-24 19:27

python爬虫求助

求助:
问题如下,爬虫https://www1.rmfysszc.gov.cn/projects.shtml?dh=3&st=0这个网站,但是爬虫获取的数据不对,显示如下:



请问是什么原因????????有人可以帮帮我吗?????



代码如下:import requests
data={'type': 0,'name': "花园",'area':' ' ,'state': 0,'time': 0,'time1':' ' ,'time2':' ' ,'money':' ' ,'money1':' ' ,'number': 0,'fid1': ' ','fid2': ' ','fid3': ' ','order': 0,'page': 1,'include': 0}
#User_Agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3314.0 Safari/537.36 SE 2.X MetaSr 1.0"
#Referer="https://www1.rmfysszc.gov.cn/projects.shtml?dh=3&st=0"
#cookie="__jsluid_s=ddd2d8cfda5ff28c4ba2acad0ed3cf20; UM_distinctid=16c0d3f0120c7-0b749f7dc00d17-4d045769-1fa400-16c0d3f0121408; ASP.NET_SessionId=rz5kiciouk2wypvtacsakpxt; Cookies-01=59063098"
#headers={"User-Agent":User_Agent,"Cookie":cookie,"Referer":Referer}
response = requests.post("https://www1.rmfysszc.gov.cn/ProjectHandle.shtml",data=data,headers=headers)
print(response)
print(response.text)

loery_chen 发表于 2019-8-24 21:16

新人求助!!!别沉呀

loery_chen 发表于 2019-8-24 21:27

已解决,将data="type=0&name=%E8%8A%B1%E5%9B%AD&area=&state=0&time=0&time1=&time2=&money=&money1=&number=0&fid1=&fid2=&fid3=&order=0&page=1&include=0”就可以了
页: [1]
查看完整版本: python爬虫求助