I've gone through a few somewhat similar questions and tried the suggestions, but I haven't quite gotten to an answer. I'm trying to download a CSV file of a Redmine forum using Python.
If I follow the link below within a browser (on a network that can access it), it will immediately download the CSV file.
http://bugs.internal.com/projects/issues/issues.csv?utf8=%E2%9C%93&columns=all&description=1
And I'm just looking for the same behavior from Python. Here's what I've tried so far. I think this should be printing the whole CSV file, but it just prints a blank.
import csv
import requests
CSV_URL = 'http://bugs.internal.com/projects/issues/issues.csv?utf8=%E2%9C%93&columns=all&description=1'
with requests.Session() as s:
download = s.get(CSV_URL)
decoded_content = download.content.decode('utf-8')
cr = csv.reader(decoded_content.splitlines(), delimiter=',')
my_list = list(cr)
for row in my_list:
print(row)
Does anyone have any pointers? I think it's something with the URL, but I don't know where to start.