Parsing JSON variables on Instagram -


I'm trying to get all JSON variables and values ​​from an Instagram page

IE: View-source:

Is there any work that you recommend?

I tried to use json_decode but not all pages are Jason - it will only be empty for me

  $ instagram_url = "http://instagram.com/justinbieber"; $ Html = file_get_contents ($ instagram_url) $ doc = new DOMDocument (); $ Doctor & gt; LoadHTML ($ HTML); $ Xpath = new DOMXPath ($ doc); $ Js = $ xpath- & gt; Query ('// body / script') - & gt; Item (1) - & gt; Nodeville; $ Start = strpos ($ js, '{'}; $ End = strrpos ($ JS, ';'); $ Json = substr ($ JS, $ start, $ end - $ start); Var_dump ($ json);  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -