python 爬虫代理
生活随笔
收集整理的這篇文章主要介紹了
python 爬虫代理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
示例代碼:<python3>
import urllib.request
import random
url = "http://www.cnblogs.com/cdxing"
?
?
proxy_handler = urllib.request.ProxyHandler({
??? 'https': 'http://211.155.234.99:80',
??? 'https': 'http://218.75.100.114:8080'
})
opener = urllib.request.build_opener(proxy_handler)
response = opener.open(url)
print(response.read().decode('utf-8'))
轉載于:https://www.cnblogs.com/cdxing/p/7132800.html
總結
以上是生活随笔為你收集整理的python 爬虫代理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: webpack安装和配置
- 下一篇: [算法题] Add Two Number