from the title it may look a duplicate of other questions, but would request to read the question and if it is duplicate please point me to that thread. I am trying to read the data from a URL:
Here is the code
import requests
url = 'https://www.eticketing.co.uk/tottenhamhotspur/interfaces/availability_isc.ashx?eventref=8570'
local_filename = 'abc.xml'
with requests.get(url, stream=True) as r:
with open(local_filename, 'wb') as f:
for data in r.iter_content(chunk_size=512):
f.write(data)
Another way for doing above
local_filename = 'abc1.xml'
r = requests.get(url)
with open(local_filename, 'wb') as f:
f.write(r.content);
Neither abc.xml not abc1.xml have same data as on url, on that url there are 51608, but lines that get copied are sometimes 50140, sometimes 51124 and so on.
I am not sure if I am doing something wrong, but I want to copy all the data from that URL into a local file.