Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created March 3, 2021 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/1b6a747c9bd1ee096a70c3b1f9b68aac to your computer and use it in GitHub Desktop.
Save amankharwal/1b6a747c9bd1ee096a70c3b1f9b68aac to your computer and use it in GitHub Desktop.
from urllib.request import urlopen
response = urlopen('http://stackoverflow.com/questions?sort=votes')
data = response.read()
encoding = response.info().get_content_charset()
html = data.decode(encoding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment