# coding utf-8
from urllib.request import Request,urlopen
from urllib.parse import urlencode
url = "http://acm.hdu.edu.cn/userloginex.php?action=login&cid=0¬ice=0"
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36 Edg/83.0.478.54"
}
from_data = {
"username": "*******",
"userpass": "*******"
}
f_data = urlencode(from_data)
request = Request(url,data=f_data.encode(),headers=headers)
response = urlopen(request)
print(response.read())
post请求的应用
最新推荐文章于 2022-03-13 13:51:13 发布