import urllib.request #构建一个Handler处理器,传入一个代理ip httpSwitch=urllib.request.ProxyHandler({"http":"120.232.175.244:80"}) #构建一个opene对象 openr=urllib.request.build_opener(httpSwitch) req=urllib.request.Request("http://www.baidu.com/") text=openr.open(req) print(text.read())
通过代理ip,爬取百度信息
最新推荐文章于 2024-08-05 23:13:57 发布