python實現通過代理服務器訪問遠程url的方法
來源:懂視網
責編:小采
時間:2020-11-27 14:33:08
python實現通過代理服務器訪問遠程url的方法
python實現通過代理服務器訪問遠程url的方法:本文實例講述了python實現通過代理服務器訪問遠程url的方法。分享給大家供大家參考。具體如下: import urllib proxies = {'http' : 'http://proxy:80'} urlopener = urllib.FancyURLopener(proxies) htmlpage = u
導讀python實現通過代理服務器訪問遠程url的方法:本文實例講述了python實現通過代理服務器訪問遠程url的方法。分享給大家供大家參考。具體如下: import urllib proxies = {'http' : 'http://proxy:80'} urlopener = urllib.FancyURLopener(proxies) htmlpage = u

本文實例講述了python實現通過代理服務器訪問遠程url的方法。分享給大家供大家參考。具體如下:
import urllib
proxies = {'http' : 'http://proxy:80'}
urlopener = urllib.FancyURLopener(proxies)
htmlpage = urlopener.open('http://www.baidu.com')
data = htmlpage.readlines()
print data
希望本文所述對大家的Python程序設計有所幫助。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
python實現通過代理服務器訪問遠程url的方法
python實現通過代理服務器訪問遠程url的方法:本文實例講述了python實現通過代理服務器訪問遠程url的方法。分享給大家供大家參考。具體如下: import urllib proxies = {'http' : 'http://proxy:80'} urlopener = urllib.FancyURLopener(proxies) htmlpage = u