get
import requests
new_url = "http://xxx"
headers = {"Connection":"xxx","Host":"xxx","User-Agent":"xxx",
"Cookie":"xxx"}
response = requests.get(new_url,headers = headers)
with open("xxx.html", "w", encoding="utf-8") as f:
f.write(response.content.decode());
print(response.text)
# print(response.json())
post
import requests
new_url = "http://xxx"
headers = {"Connection":"xxx","Host":"xxx","User-Agent":"xxx",
"Cookie":"xxx"}
response = requests.post(new_url,headers = headers)
sp = {"name":"xxx","id":111}
response = requests.post(new_url,headers = headers,data=sp)
with open("xxx.html", "w", encoding="utf-8") as f:
f.write(response.content.decode());
print(response.text)
# print(response.json())