How can I get python to get the contents of an HTTP page? So far all I have is the request and I have imported http.client.
The urllib module in Python 3 allows you access websites via your program. This opens up as many doors for your programs as the internet opens up for you. urllib in Python 3 is slightly different than urllib2 in Python 2, but they are mostly the same.
Using urllib.request
is probably the easiest way to do this:
import urllib.request f = urllib.request.urlopen("http://stackoverflow.com") print(f.read())
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