javascript - Scraping a url ending in .js using python -


i trying historical earnings data website using python. url data ends in .js (which javascript link). problem if use urllib.urlopen read link, converts string , it's nightmare extract data string. wondering if there module allows download data in similar json.

the link trying scrape is: http://test.optionslam.com/site_media/chart/data/goog_data.js

this how trying it:

data = urlopen('http://test.optionslam.com/site_media/chart/data/goog_data.js').read()

can please suggest better approach this?

just remove var = parts , terminating ; , use json parser on rest. sure such thing exists python.

something this:

  • get string do
  • replace var {
  • replace = :
  • replace ; },
  • remove last ,
  • read in json

Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -