0

I want to fetch table data from the website using perl: http://finance.yahoo.com/quote/LBJ/history?period1=946665000&period2=1470162600&interval=div%7Csplit&filter=split&frequency=1d but it's source code does not contains any data of table which we can see on website, there is one download link but that downloaded data is not same as data shown on website.I want stock split information shown on this website, yahoo provides download link to download that data but here downloaded data is different then they shown on website, by mistake they provide dividend history information,but I want split history information.

Sanket
  • 59
  • 5
  • 1
    are you tried anything on code? – ssr1012 Aug 04 '16 at 06:58
  • It may well be that the website uses some javascript to deliver the final content. The `LWP::UserAgent` might be able to handle this, so you might want to give it a try. – Mäx Müller Aug 04 '16 at 07:35
  • 1
    Possible duplicate of [how can i extract special kind of table from website in perl?](http://stackoverflow.com/questions/38567448/how-can-i-extract-special-kind-of-table-from-website-in-perl) – Matt Jacob Aug 04 '16 at 23:11

1 Answers1

0

The page is built using a number of Javascript calls.

You should use the developer tools that are built in to your browser to trace all of the HTTP requests that are used to build the page. One of them will return the data which is used to build the table. Hopefully you will be able to recreate that call to get the data directly. It's likely that the data will be returned as JSON, which will make parsing it much easier.

Update: It's worth adding that sites often build pages this way precisely because they don't want people to scrape their data. Have you checked the terms and conditions of the site? Are you allowed to access the data this way? HAve you looked to see if you can get this data through an API?

Dave Cross
  • 68,119
  • 3
  • 51
  • 97