0

I'd like to get some data regarding stocks from :http://finance.yahoo.com/q?s=AAPL and i'm wondering if there is any way to accees the DOM of this page from my application. Let's say i have the this query: http://finance.yahoo.com/q?s=AAPL, i tried to access the DOM from the Chrome console : console.log (document.head.innerText), but o couldn't find a way to access it using my local script file.

Alex Brodov
  • 3,365
  • 18
  • 43
  • 66

2 Answers2

1

You won't be able to access directly the content of that page from another page in Javascript, because of same-origin policy (given that your app is a website on another domain). The best way would be to write a backend working as a proxy and API for your app. Or maybe Yahoo finances already has a public API ;)

Antoine
  • 5,504
  • 5
  • 33
  • 54
-1

You can't access the DOM with cross domain. In other hand you can make a GET request with jQuery before exploit the DOM.