Skip to content

Instantly share code, notes, and snippets.

@MamdouhAlShamy
Created August 13, 2018 00:56
Show Gist options
  • Save MamdouhAlShamy/23091406e8a597da613a8833dab17047 to your computer and use it in GitHub Desktop.
Save MamdouhAlShamy/23091406e8a597da613a8833dab17047 to your computer and use it in GitHub Desktop.
simple python website reader
import requests
from urllib.request import urlopen
class HomePage:
def news(self):
url = "https://maktoob.yahoo.com/?p=us"
r = requests.get(url)
print(r.status_code)
page = urlopen(url).read()
print(page)
hp = HomePage()
hp.news()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment