My urllib (python)

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

What is urllib used for?

Connection to URL and operation. Well, if you have a WebDriver, that's fine!


Module loading

import urllib

Frequent operation

#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

My urllib (python)
My Numpy (Python)
My sys (python)
My pyproj (python)
My pandas (python)
My str (python)
My pyautogui (python)
My shutil (python)
My matplotlib (python)
My pyperclip (python)
My sklearn (python)
[My memo] python
My ConfigParser (Python)
My Webdriver (Python)
My arcpy (python)
My win32gui (Python)
My os (python)
My python environment memo
My Beautiful Soup (Python)
[My memo] python -v / python -V
Python Tips (my memo)
My python data analysis container
Python
My python data analytics environment
Simple OAuth 2 in Python (urllib + oauthlib)
I made my own Python library
[Python] My stock price forecast [HFT]
My favorite boto3 (Python) API sample
Python My Number verification module released
kafka python
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python technique
Studying python
Python 2.7 Countdown
Python memorandum
python tips
python function ①
Python basics
Python memo
ufo-> python (3)
install python
Python Singleton
Python basics ④
Python Memorandum 2
python memo
Python Jinja2
Python increment
atCoder 173 Python
[Python] function
Python installation
python tips
Installing Python 3.4.3.
Try python
Python iterative
Python algorithm
Python2 + word2vec
[Python] Variables
Python functions