|

楼主 |
发表于 2020-8-24 09:46:46
|
显示全部楼层
too many connections
或者
gateway time-out
我还是用的甲鱼老师原码
- import urllib.request as rq
- import random
- url ='http://www.whatismyip.com.tw'
- iplist=['115.223.7.110:80','115.29.108.117:8118']
- proxy_support=rq.ProxyHandler({'http':random.choice(iplist)})
- opener= rq.build_opener(proxy_support)
- opener.add_handler=[('User-Agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 ')]
- rq.install_opener(opener)
- response=rq.urlopen(url)
- html=response.read().decode('utf-8')
- print(html)
复制代码
难道是这么多年python语法或者url啥的有变动? |
|