首页 > 其他 > 详细

一个练习题的代码

时间:2018-07-06 17:21:28      阅读:209      评论:0      收藏:0      [点我收藏+]
import requests
import re
header={
‘Cookie‘: ‘gxfda_supervise_id=0000QdmIkkDNPaUemUTEEPvggv6:19lo8hslj‘,
‘User-Agent‘: ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36‘,
‘Referer‘: ‘http://oa.gxfda.gov.cn/gxfda_supervise/appnet/appEntpList.action?entpType=002‘,
}
source=requests.get(‘http://www.gxfda.gov.cn/gxfdanet/gxdataylqxscqy.jhtml‘,headers=header).text
# print(source)
url=re.compile(‘<iframe border="0" frameborder="0" framespacing="0" height="725" marginheight="0" marginwidth="0" name="12" noresize scrolling="no" src="(.*?)" width="1003" vspale="0"> </iframe>‘,re.S).findall(source)
print(url)
source1=requests.get(url[0],headers=header).text
# print(source1)
token=re.compile(‘<input type="hidden" name="token" value="(.*?)" />‘).findall(source1)
print(token[0])
data={
‘token‘:token[0],
‘pageNumber‘: ‘1‘
}
s=requests.post(‘http://oa.gxfda.gov.cn/gxfda_supervise/appnet/appEntpList.action‘,headers=header,data=data).text
print(s)

一个练习题的代码

原文:https://www.cnblogs.com/mypath/p/9274445.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!