Skip to content

Instantly share code, notes, and snippets.

@renfredxh
Created August 18, 2013 18:44
Show Gist options
  • Save renfredxh/6263247 to your computer and use it in GitHub Desktop.
Save renfredxh/6263247 to your computer and use it in GitHub Desktop.
Scrape and print a site's HTML with python 3
from urllib.request import urlopen
from bs4 import BeautifulSoup
webpage = urlopen('https://www.google.com')
soup = BeautifulSoup(webpage)
print(soup.prettify())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment