import requests
url = 'https://www.baidu.com/s?wd=ip'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36',
'Connection':'close',
'verify':'False'
}
page = requests.get(url=url,headers=headers,proxies= {'https':'114.239.29.169'})
print(page.status_code)
page.encoding='utf-8'
page_text=page.text
with open ('ip.html','w',encoding='UTF-8') as fp:
fp.write(page_text)
#透明
#匿名
#高匿
#针对ip封锁
python爬虫学习(十九)IP代理
最新推荐文章于 2024-09-01 16:57:39 发布