PhantomJS simple instance _ PHP Tutorial

Source: Internet
Author: User
PhantomJS simple example. PhantomJS is a WebKit-oriented browser that provides JavaScript programming interfaces (APIs. It provides quick and native support for web standards: DOM operations, CSS delimiters, JSON, and PhantomJS are WebKit-oriented non-interface browsers that provide JavaScript programming interfaces (APIs. It provides FastAnd NativeSupported: DOM operations, CSS delimiters, JSON, Canvas, and SVG.

1. download and unzip PhantomJS http://phantomjs.org/

2. write simple test code and save it as test. js. after decompression, there are a large number of instances in phantomjs \ examples for your reference.

Console. log ('loading a web page' page = require ('webpage' url = 'http: // www.phantomjs.org/'(status! = 'Success' 'Unable to post! '

3. because I am using windows, I enter the CMD command line mode to run test. js and use the pipeline token to output the result to test.txt. if the pipeline is not used, the result is output directly.

.

4. Because PhantomJS supports command line, we can use PHP, Java, or Python to directly obtain the result during development.

APIs. It provides quick and native support for web standards: DOM operations, CSS delimiters, JSON ,...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.