php-phantomjs icon indicating copy to clipboard operation
php-phantomjs copied to clipboard

Im not understand about page automation ,It's really difficult.

Open amhoho opened this issue 8 years ago • 1 comments

Im not understand about page automation ,It's really difficult. :http://jonnnnyw.github.io/php-phantomjs/4.0/4-custom-scripts/ Can you do some demo? //fill the search form and submit it with input's name //or click sothing //or Use jQuery and Other Libraries when page.loadFinished

amhoho avatar Sep 04 '17 07:09 amhoho

The procedure_default.partial file is raw PhantomJS code. So if you want to do page automation you stick it in between a function call like so...

response.content = page.evaluate(function () {
    // all code in here is executed in the "browser"
    return document.getElementsByTagName('html')[0].outerHTML
});

PhantomJS has good documentation on how to do advanced stuff with this.. http://phantomjs.org/page-automation.html

andrewfenn avatar Sep 07 '17 10:09 andrewfenn