Hugh Chalmers Hugh Chalmers - 5 months ago 56
Python Question

Read text file over internet on python

Here's a text file on the internet (http) How would I print that in Python 2?

People are saying this is a duplicate, I would like to say that it is not a duplicate, any other script I found gave Error 412.

wim wim
>>> from urllib2 import Request, urlopen
>>> url = ''
>>> urlopen(Request(url=url, headers={'User-Agent': "hey, it's wim"})).read()
'Exmaple Text'