israel-dryer / Yahoo-Finance-Scraper

A webscraper to extract historical stock and other meta data from Yahoo! Finance
18 stars 18 forks source link

Yahoo website update #1

Open therealblitz00 opened 2 years ago

therealblitz00 commented 2 years ago

c:\Users\Manuel Sampaio\Documents\teste\teste.ipynb Cell 5' in <cell line: 2>() 1 pattern = re.compile(r'\s--\sData\s--\s') ----> 2 script_data = soup.find('script', text=pattern).contents[0]

AttributeError: 'NoneType' object has no attribute 'contents'

Any help please

doublec1985 commented 1 year ago

check your request and make sure you are getting a 200 status code. If not most likely you need to add a header to your get request as YF does not like people scraping their site.