Skip to main content

Silene is an open source web crawler framework built upon Pyppeteer.

Project description

Silene

Silene is an open source web crawler framework built upon Pyppeteer.

Requirements

You must have at least Python 3.7 installed.

Installation

To install the latest release run pip install silene.

Quickstart guide

Each crawler must subclass the Crawler class and implement the abstract configure method. The CrawlerConfiguration specifies the initial requests to make and other properties of the crawler. Once a request is processed, the appropriate callback will be invoked. By default, in case of a successful request the on_response_success callback will be executed. This is where you can interact with the page content. You can also specify custom callbacks for your requests.

Below you can find a very simple implementation.

Example code snippet

from silene.crawl_request import CrawlRequest
from silene.crawl_response import CrawlResponse
from silene.crawler import Crawler
from silene.crawler_configuration import CrawlerConfiguration


class MyCrawler(Crawler):
    def configure(self) -> CrawlerConfiguration:
        return CrawlerConfiguration([CrawlRequest('https://example.com')])

    def on_response_success(self, response: CrawlResponse) -> None:
        # Do something with the response...
        pass

Development instructions

Prerequisite

This project requires Pipenv to be installed.

Create environment

Run pipenv install --dev to create a new virtual environment and install the necessary packages.

Run tests

Run pytest in the project root folder.

Run tests with coverage

Run pytest --cov=silene in the project root folder.

License

The source code of Silene is made available under the Apache License, Version 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silene-1.0.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silene-1.0.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file silene-1.0.0.tar.gz.

File metadata

  • Download URL: silene-1.0.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3

File hashes

Hashes for silene-1.0.0.tar.gz
Algorithm Hash digest
SHA256 418a639cdfc2b18ed2405c2b8c154b4a8c2f75a705c1f0f6b9f4590b9f313a40
MD5 23e1132d53ab1700145e3d9bef3030f9
BLAKE2b-256 3af2321900fb22350c85908c74fa46abcb9a9b860bc1805d083aa69f4e01896e

See more details on using hashes here.

File details

Details for the file silene-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: silene-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3

File hashes

Hashes for silene-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a180e5ff62e1eadd50b63708631ee7f1d5d4654eeb2562bf6c723e86a8b211
MD5 a0ddf545f20156e6913e64071f4f34d4
BLAKE2b-256 8b8f72a81ad216e3864c182f47ce2b925127a860c6aef20ebad88d2e8c01429c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page