Summary for myself Updated from time to time
** I just need to know myself, so the terms may be wrong in some places **
!! View
#command
#Argument option description
Connection to URL and operation. Well, if you have a WebDriver, that's fine!
import urllib
#Proxy settings
proxy = urllib.request.PloxyHandler()
#Pass the proxy settings in dictionary type as an argument.
#Like this →{'http': 'http://proxy.sample.com:8080'}
#Create an object that opens a url
opener = urllib.request.build_opener()
proxy= #PloxyHandler()Set the instance created in
#Install an object that opens a url
urllib.request.install_opener()
#The argument is build_instance of opener
#Connect to url
response = urllib.urlopen()
#The argument is the URL you want to open
#Get an instance of HTML
html = response.read()
Recommended Posts