0

How can I download this following file in python? I have no issue doing this in R. I believe this issue is the last row in the file which will change. How can I change the code to work?

import pandas as pd
 url = "https://ark-funds.com/wp-content/uploads/funds-etf-csv/ARK_INNOVATION_ETF_ARKK_HOLDINGS.csv"
test = pd.read_csv(url) 
2
  • 3
    What's the error? Commented Nov 6, 2021 at 0:36
  • 1
    if you are getting 403 - forbidden error, then refer to this post request with header Commented Nov 6, 2021 at 2:37

1 Answer 1

0

You should better download the csv file first by using the requests module. Then you can read the file from the download directory by passing the file path instead of the URL (pd.read_csv(download_path)).

Sign up to request clarification or add additional context in comments.

1 Comment

pd.read_csv() supports reading from a URI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.