Proxy環境下でWebスクレイピング[request][BeautifulSoup]
import urllib from bs4 import BeautifulSoup if __name__ == "__main__": proxy = urllib.request.ProxyHandler({'http': 'http://xx.xx.xx.xx:8080'}) opener = urllib.request.build_opener(proxy) url = "http://xx.xx" urllib.request.install_opener(opener) html = urllib.request.urlopen(url) soup = BeautifulSo…
2019/03/19 14:56