Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pyspider

> 编程语言
Open source

A Powerful Spider(Web Crawler) System in Python.

16.8K stars0 likes2 views
WebsiteGitHub

About

A Powerful Spider(Web Crawler) System in Python.

pyspider Build Status Coverage Status

A Powerful Spider(Web Crawler) System in Python.

  • Write script in Python
  • Powerful WebUI with script editor, task monitor, project manager and result viewer
  • MySQL, MongoDB, Redis, SQLite, Elasticsearch; PostgreSQL with SQLAlchemy as database backend
  • RabbitMQ, Redis and Kombu as message queue
  • Task priority, retry, periodical, recrawl by age, etc...
  • Distributed architecture, Crawl Javascript pages, Python 2.{6,7}, 3.{3,4,5,6} support, etc...

Tutorial: http://docs.pyspider.org/en/latest/tutorial/
Documentation: http://docs.pyspider.org/
Release notes: https://github.com/binux/pyspider/releases

Sample Code

python
from pyspider.libs.base_handler import *

class Handler(BaseHandler):
    crawl_config = {
    }

    @every(minutes=24 * 60)
    def on_start(self):
        self.crawl('http://scrapy.org/', callback=self.index_page)

    @config(age=10 * 24 * 60 * 60)
    def index_page(self, response):
        for each in response.doc('a[href^="http"]').items():
            self.crawl(each.attr.href, callback=self.detail_page)

    def detail_page(self, response):
        return {
            "url": response.url,
            "title": response.doc('title').text(),
        }

Installation

  • pip install pyspider
  • run command pyspider, visit http://localhost:5000/

WARNING: WebUI is open to the public by default, it can be used to execute any command which may harm your system. Please use it in an internal network or enable need-auth for webui.

Quickstart: http://docs.pyspider.org/en/latest/Quickstart/

Contribute

  • Use It
  • Open Issue, send PR
  • User Group
  • 中文问答

TODO

v0.4.0

  • a visual scraping interface like portia

License

Licensed under the Apache License, Version 2.0

Issues· 300 open

View all issuesOpen on GitHub
  • #965

    Pyspider commandline had error: invalid syntax

    Updated Jun 3, 2024
  • #998

    pyspider all 命令执行之后,没有报错但是web页面也打不开

    Updated Apr 30, 2024
  • #995

    Can't pickle <function cli at 0x105140a60>: it's not the same object as pyspider.run.cli

    Updated Apr 9, 2024
  • #997

    Potential Side Channel Attack on non-constant time Comparison

    Updated Apr 8, 2024
  • #950

    PicklingError when input pyspider

    Updated Mar 4, 2024
  • #919

    cannot run pyspider!

    Updated Dec 13, 2023
  • #994

    Fail to start pyspider - TypeError: Can't instantiate abstract class ScriptProvider with abstract methods get_resource_inst

    Updated Sep 27, 2023
  • #991

    syntaxError

    Updated Sep 4, 2023
  • #908

    webui .debug-itag height是不是增加个高度,不要iframe太小了。

    Updated Apr 16, 2023
  • #959

    hope debug page .iframe-box > iframe add height=100%

    Updated Apr 16, 2023

> Tags

Pythoncrawlerpython

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言