how to read website from url using python

43

python get html from url -

import requests

url = requests.get("http://google.com")
htmltext = url.text

python read url -

import urllib

link = "http://www.somesite.com/details.pl?urn=2344"
f = urllib.urlopen(link)
myfile = f.read()
print(myfile)

Comments

Submit
0 Comments