I wanted to use urllib2 for python 3, but I don't think it's available in such name.
I use urllib.request, is there another way to use urllib2?
urllib2 in Python 3 has been split into several modules:
The
urllib2module has been split across several modules in Python 3 namedurllib.requestandurllib.error. The2to3tool will automatically adapt imports when converting your sources to Python 3.
urllib.request is what you want to use for issuing HTTP requests.
Alternatively, the open source Requests library provides a simpler and cleaner API for making HTTP requests in both Python 2 and 3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With