Crawling dynamic pages with PYTHON+PHANTOMJS

Source: Internet
Author: User

Some time ago the company needed to crawl some Web pages for data usage. But the main data in the page is Ajax load, the traditional method of fetching is not the data. Later found on the Internet phantomjs, in the absence of the interface to run JS, rendering the DOM. It 's convenient to use this tool to grab the data from the AJAX load.

system Environment: CentOS release 6.5 (Final)

PHANTOMJS version: 1.9.8

  • phantomjs Crawl loads the full DOM structure. Speaking of Phantomjs how to pass data to handlers, I see a lot of people on the web are writing a local file, and then the specific handler then reads that file for processing. Feeling this way is too troublesome, simply print the data to the standard output, and the handler reads the data from the standard output.

    • get data in Python. And then we started to deal with it. The specific processing logic is not shown.

Crawling dynamic pages with PYTHON+PHANTOMJS

Related Article

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.