Python的requests使用代理代码

from piaot import *
import requests
url = ‘http://www.xicidaili.com

如果代理需要使用HTTP Basic Auth,可以使用下面这种格式:

headers={

'User-Agent':pa()

}
response = requests.get(url,headers=headers)
print(response.text)

猜你喜欢

转载自blog.csdn.net/Black_God1/article/details/81750734