wumac
import urllib.request

url = \'http://www.whatismyip.com.tw/\'

proxy_support = urllib.request.ProxyHandler({\'HTTP\':\'180.104.62.22:9000\'})

opener = urllib.request.build_opener(proxy_support)
opener.addheaders = [(\'User-Agent\',\'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36\')]



urllib.request.install_opener(opener)

response = urllib.request.urlopen(url)

html = response.read().decode(\'utf-8\')

print(html)

 

分类:

技术点:

相关文章:

  • 2021-11-12
  • 2021-04-24
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-12-01
  • 2021-10-16
猜你喜欢
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2021-10-07
  • 2021-11-26
相关资源
相似解决方案