1, Introduction
in the the Python Instant web crawler project: Definition of content extractor we've defined a generic Python web crawler that expects to save more than half the programmer's time through this project. This article will use an example to explain how to use this reptile. We will crawl collection of old forum, is a use Drupal forum.
2, Technical points
we are saying in multiple articles: Save the programmer time. The key is to omit the time to write the extraction rules, especially the correctness of the debugging rules takes time. quickly generate XSLT for Web content extraction in 1 minutes "demonstrates how to quickly generate extraction rules, and then we get the extraction rules in real time through the API interface of Gooseeker and crawl the Web pages." This example has the following two key technical points:
- Real-time access to XSLT for page extraction via the Gooseeker API
- Use the Gooseeker extractor gsextractor to extract multiple field contents at once from a Web page.
3,python Source Code
Source code download location see GitHub Source at the end of the article.
4, crawl results
Run the code of the previous section, you can print out the extract results in the console, is an XML file, if you add a newline indent, the content such as:
5, related documents
1, Python instant web crawler project: Definition of content extractor
6, set search Gooseeker source code Download
1,gooseeker Open Source python web crawler github source
7, Document modification history
1, 2016-06-07:v1.0
2,2016-06-07:v2.0
3,2016-06-07:v2.1, add github download source
Python crawler Combat (1): Crawl a list of Drupal forum posts