jonnnnyw / php-phantomjs

Execute PhantomJS commands through PHP
MIT License
1.44k stars 432 forks source link

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

Open amhoho opened 7 years ago

amhoho commented 7 years ago

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

andrewfenn commented 7 years ago

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