python import and print url

here is an example script that imports html from a url and prints it

add it to a .py file and then run it with python3


from urllib.request import urlopen
url = ""
page = urlopen(url)
html_bytes =
html = html_bytes.decode("utf-8")

No Items Found.

Add Comment
Type in a Nick Name here
Page Views

This page has been viewed 111 times.

Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.


Random Quote
The mind must be given relaxation; it will arise better and keener after resting. As rich fields must not be forced-for their productiveness, the have no rest, will quickly exhaust them constantlabor will break the vigor of the mind, but if it is released and relaxed a little while, it will recover its powers