[Python] 纯文本查看 复制代码 import requests
from lxml import etree
url='http://121.43.172.248/'
req=requests.session()
res=req.get(url)
html=etree.HTML(res.text)
view=html.xpath('//*[@id="__VIEWSTATE"]/@value')
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
'Referer': 'http://121.43.172.248/'
}
data={
'__EVENTTARGET':'',
'__EVENTARGUMENT': '',
'__LASTFOCUS': '',
'__VIEWSTATE':view,
'txtUserName': '123',
'txtPSW': '456',
'HiddenField1': '',
'HiddenField2': '',
'UICultureDropDownList': 'ZH-CN',
'LoginButton': ''
}
res=req.post(url,data=data,headers=headers)
print(res.text)
|