> >

Re: PHP combines phantomjs to achieve webpage screenshots and JS rendering pages.

time:18-07-19 forum:PHP tools and code
  The following script uses the simplest usage of the sample page object, which loads example.com and saves it as a picture, example.png.

var page = require ('webpage').Create ();
page.open ('http://example.com', function () {
>); because of its feature, it can be used to intercept a web page to intercept a snapshot of some content, such as a web page, a memory As a picture, PDF and so on, this function is very X.

the next loadspeed.js script loads a special URL (don't forget the HTTP protocol) and measures the time to load the page.

var page = require ('webpage').Create (),
system = require ('system'),
= = = = = = = = = = = = = = = = = = = 1)
  • 1
  • 2
  • 3
  • 4

prev:no prev next:no next
post comments
Notice



Approved   Ji'nan Ying Bi Street School: specia...   Reminder: at present, there are only...   Online test site PING value, network...   Expired domain name query   Query the operation system informati...
rand   Formal release of PHP 5.3.6   Generating HTML static pages with PH...   PHP reads the content of the MySQL d...   PHP time function date () solves the...   Using iconv to transform UTF-8 Chine...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com