0

I'm trying to make a little tool which scrape the pictures of an instagram account using PHP simple dom parser.

However when I try to extract content using the parser I get a blank page. Is there anyway to make it work with instagram ?

require 'simplehtmldom_1_5/simple_html_dom.php'; 


// Create DOM from URL or file
$html = file_get_html('https://www.instagram.com/techcrunch/');

// Find all images 
foreach($html->find('img') as $element) 
   echo $element->src . '<br>';
casusbelli
  • 463
  • 1
  • 5
  • 22
  • Possible duplicate of [Instagram public RSS feed](http://stackoverflow.com/questions/14747870/instagram-public-rss-feed) – CarlosCarucce May 23 '16 at 16:27

1 Answers1

1

If you look at the source of https://www.instagram.com/techcrunch/ you'll see that it has no <img> tags in it. These are created later by JavaScript.

Using the official instagram APIs might be a better option.

There are alternatives, but they are a bit hackish and may stop working at any time.

Community
  • 1
  • 1
Shira
  • 6,392
  • 2
  • 25
  • 27