TJ1
TJ1

Reputation: 8508

Scraping Javascript based websites with Python

I am trying to scrap data from here (using python 2.7):

http://financials.morningstar.com/valuation/earnings-estimates.html?t=AMD

When I right click and choose "View Page Sources" in Chrome browser, the content that I am looking for is not there. For example I am looking for "Average Rating".

I searched Stackoverflow and saw this question and answer: Python 3, Web-scraping, and Javascript [Oh My] But when I tried the main answer, I could not find any XMLHttpRequest function.

I appreciate any help on this.

Upvotes: 1

Views: 354

Answers (1)

Hugh Bothwell
Hugh Bothwell

Reputation: 56694

It looks like the data you want is pulled from

http://financials.morningstar.com/valuation/annual-estimate-list.action?&t=XNAS:AMD&region=usa&culture=en-US&cur=&r=1425167484279.9668&_=1425167484280
http://financials.morningstar.com/valuation/analyst-opinion-list.action?&t=XNAS:AMD&region=usa&culture=en-US&cur=&r=1425167484282.3906&_=1425167484282
http://financials.morningstar.com/valuation/forward-comparisons-list.action?&t=XNAS:AMD&region=usa&culture=en-US&cur=&r=1425167484284.5396&_=1425167484284

You should be able to scrape these urls directly.

Upvotes: 1

Related Questions