python - get csv data from a website -


How do I download CSV data on website using Python and

It depends on what you want to do with the data. If you just want to download the data that you can use.

  import urllib2 download_data = urllib2.urlopen ('http: // ...') downloaded_data.readline () in: print  

Python 2.x

  import csv import urllib2 download_data = urllib2.urlopen ('http: // ...') for the line in csv_data csv_data = csv.reader (downloaded Gone_data): print line   

Python 3.X

  import csv import urllib.request download_data = urllib.request. Csv_data: print (line)    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -