-1

I would like to create a script that automates the process of clicking a "download as CSV" file on a website. Here is an example of a csv I want to download (near the bottom of the page there is a download button). I double clicked the button and hit inspect element on chrome and got the link that downloads the csv file:

https://www.draftkings.com/contest/exportfullstandingscsv/90543300

How can I read this link into a pandas dataframe? .read_csv() doesn't work since we have the link that gets the csv and not the csv itself, and trying .read_html() returns an error that no tables are found.

Again, I am trying to use python to automate the process of clicking the download as csv button. Thanks in advance.

bismo
  • 1,257
  • 1
  • 16
  • 36

1 Answers1

0

What you need here is to perform a GET request on the given URL. You can use Python's requests library to achieve that:

import requests

url = 'your/url/here'
r = requests.get(url)

# you can then read the contents using `r.contents`
Anis R.
  • 6,656
  • 2
  • 15
  • 37