Eric Eric - 7 months ago 17
Python Question

Return data from URL with Python

I want to read stock data into a pandas dataframe. This question roughly matches what I want to do, but it recommends web scraping. I don't want to rely on web scraping to get my data, as I might need to rewrite my scraper if the website is redesigned.

How can I get the data from this website into a pandas dataframe without web scraping?

Answer

Just pass the url to pandas.read_csv

import  pandas as pd

df = pd.read_csv("http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&render=download")

print(df)