I am trying to download a google spreadsheet in the form of CSV. But the script will always redirect me to login page even I provided the user name and password. Any suggestion to fix this?
import requests
from requests.auth import HTTPBasicAuth
response = requests.get('https://docs.google.com/spreadsheet/ccc?key=1Kwim1GF0SXx24kN8LycaYF6LUsJAIAm6FkPStDqDoNE&output=csv',auth=HTTPBasicAuth('xxxxxx', 'xxxxxxx'))
data=response.content
csv_file = open(r"C:\google_sheet\bills.csv", "w")
csv_file.write("%s" % data)
csv_file.close()