lundi 19 août 2019

Not able to authenticate website with python using google colab but the code works with anaconda

Issue : I have to download a csv from a webpage using python. I am able to do using local anaocanda environmet but when I try using google colab it fails - Do I need to do change some proxy settings??

import requests
from requests.auth import HTTPBasicAuth
import csv
import urllib3
urllib3.disable_warnings()
r =  requests.get('https://partnermdm.dmzmo.xyz.corp/export/Orders_Entries.csv',stream = True , verify = F`enter code here`alse ,auth=('bwp', '00kwNnF'))
with open("abc.txt", 'wb') as f:
     for chunk in r.iter_content(chunk_size = 1024):
     f.write(chunk)

ConnectionError: HTTPSConnectionPool(host='partnermdm.dmzmo.xyz.corp/export/Orders_Entries.csv'', port=443): Max retries exceeded with url: /export/Orders_Entries.csv (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',))




Aucun commentaire:

Enregistrer un commentaire