Skip to content Skip to sidebar Skip to footer

Can Not Download Html With Phantomjs

I have 3 different files in my project and the layout is phantomjs -->phantomjs.js -->phantomjs.exe index.php index.php: $phantom_script = dirname(__FILE__). '\phantomjs\ph

Solution 1:

your usage oh phantomjs is correct according to the documentation. http://phantomjs.org/api/webpage/property/content.html

php exec method returns the last line only. Maybe that line is a white space. http://php.net/manual/fr/function.exec.php

You shall have a seond parameter &$output, sent by reference. It is an array containing the entire output.

A problem you may face later, the content could need be to evaluated before you try to read it s DOM document content. Using for example innerHTML of HTML tag, ie: $('html').html();

If the page does not have jquery, you may include it, see this example, https://github.com/ariya/phantomjs/blob/master/examples/phantomwebintro.js

Note also that google may actively desire to not let users scrap and save their search results. Not sure about that.

Post a Comment for "Can Not Download Html With Phantomjs"