0

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.

JDP
  • 25
  • 5
  • I tried it out with the following URL and it works fine ```http://winterolympicsmedals.com/medals.csv``` – eandersson Jun 01 '16 at 22:22
  • This also works for me. However copying the URL I have above, and the URL you provided results in exactly the same behavior on my browser, but my URL still doesn't do anything in Python. – JDP Jun 01 '16 at 22:30
  • It's unfortunately impossible for us to assist here, as the page you linked is internal. – eandersson Jun 01 '16 at 22:32
  • I'm pretty sure someone with knowledge of Redmine or how to authenticate or login through requests would be able to at least point me in the right direction. – JDP Jun 01 '16 at 22:43
  • You are right, I assumed that this was an internal only site. – eandersson Jun 01 '16 at 23:22

0 Answers0