python
Posted in
5
1:11 am, April 4, 2021
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 filename.py
Python
from urllib.request import urlopen
url = "http://olympus.realpython.org/profiles/aphrodite"
page = urlopen(url)
html_bytes = page.read()
html = html_bytes.decode("utf-8")
print(html)
https://realpython.com/python-web-scraping-practical-introduction/
View Statistics
This Week
49
This Month
203
This Year
0
Add Comment
Other Items in python
Related Search Terms
Other Categories in Code
c testing apache apps asp bat bootstrap bootstrap templates core css css grid design elements fancybox fonts foundation framework gimp git html icons ideas images javascript jquery js linux mac nginx node php php functions php simple html dom pi400 python react sections site bugs site documentation sql sqlite sublime svg templates tools virtual box webdev windows wordpress