Library usage requests

import requests

headers = { "headers header file"}
URL = 'http://www.baidu.com/'
HTML = requests.get (URL, headers = headers)
html.encoding = 'GBK' # converted into the format of the site
print (html.text)

 

See detailed usage

↓↓↓↓↓↓↓↓↓↓↓↓↓↓

https://www.cnblogs.com/mzc1997/p/7813801.html

Guess you like

Origin www.cnblogs.com/qmjy/p/11360391.html