I need to extract a javascript variable containing a multiline JSON from a remote page using a python script(2.7), and I want to use regex to do this, but my pattern does not return anything
What am I doing wrong ?
here's my code :
request = urllib2.Request("http://somesite.com/affiliates/")
result = urllib2.urlopen(request)
affiliates = re.findall('#var affiliates = (.*?);\s*$#m', result.read())
print affiliates