好友
阅读权限 10
听众
最后登录 1970-1-1
想爬公司网站的内容实现办公自动化,在post了网址之后已经登录成功,但是想要获取信息还是提示未登录,老哥们救救
import re, requests
postdic = {'userName' : '' ,
'password' : '' }
url = 'http://10.1.19.203/hbky/login'
ssn = requests.session()
resp1 = ssn.post(url, data =postdic, timeout =1000 )
url2 = 'http://10.1.19.203:8080/wzgy/jt/contract/flow/contract_list_node_1.jsp'
resp2 = ssn.get(url2, timeout =1000 )
url3 = 'http://10.1.19.203:8080/wzgy/jt/contract/flow/com.hbky.wzgy.jt.contract.search.jtContractBaseByConditionPage.biz.ext'
postdic2 = {"condition" : {
"userCategorypernew" : "'A01','A02','A03','A04','A05','A06','A07','A08','A09','A10','A11','A12','A13','A14','A15003','A16','A17','A20','A29'" ,
"seller" : "" , "billcode" : "" , "isexpired" : "" , "iscomplete" : "" , "ismanualcomplete" : "" , "istransfer" : "" ,
"signtime" : "" , "starttime" : "" , "paymethod" : "" , "purchasetype" : "" , "audinumber" : "" , "inputername" : "" ,
"businessnumber" : "LHJHDDX-202403003-3" , "issign" : "" , "name" : "" , "treaty2" : "" , "endtime" : "" , "isinvalid" : "" ,
"remark" : "" , "manageroption" : "" , "islzht" : "" , "inputer" : "" , "inputtime" : "" , "businessername" : "" ,
"startSigntime" : "" , "endSigntime" : "" , "startTreaty2" : "" , "endTreaty2" : "" , "startStarttime" : "" ,
"endStarttime" : "" , "startEndtime" : "" , "endEndtime" : "" , "mtlcode" : "" , "mtlname" : "" , "mtltype" : "" ,
"showValidContract" : "false" , "startInputTime" : "2024-01-01" , "endInputTime" : "2024-07-08" , "invalidtime" : "" ,
"nfpnum" : "" , "status" : "null" , "statuses" : ["0" , "1" , "2" , "3" , "4" , "5" , "9" ], "type" : "[1, 3]" },
"pageIndex" : '0' ,
"pageSize" : '100' , "sortField" : "" , "sortOrder" : "" , "page" : {"begin" : '0' , "length" : '100' }}
resp3 = ssn.post(url3, data =postdic2, timeout =1000 )
print (resp3.text)