requests-crawler
A web crawler based on requests-html, mainly targets for url validation test.
Features
- based on requests-html, full JavaScript support!
- support requests frequency limitation, e.g. rps/rpm
- support crawl with headers and cookies
- include & exclude mechanism
- group visited urls by HTTP status code
- display url's referers and hyper links
Installation/Upgrade
$ pip install requests-crawler
Only Python 3.6 is supported.
To ensure the installation or upgrade is successful, you can execute command requests_crawler -V to see if you can get the correct version number.
$ requests_crawler -V
0.5.3
Usage
$ requests_crawler -h
usage: requests_crawler [-h] [-V] [--log-level LOG_LEVEL]
[--seed SEED]
[--headers [HEADERS [HEADERS ...]]]
[--cookies [COOKIES [COOKIES ...]]]
[--requests-limit REQUESTS_LIMIT]
[--interval-limit INTERVAL_LIMIT]
[--include [INCLUDE [INCLUDE ...]]]
[--exclude [EXCLUDE [EXCLUDE ...]]]
[--workers WORKERS]
A web crawler based on requests-html, mainly targets for url validation test.
optional arguments:
-h, --help show this help message and exit
-V, --version show version
--log-level LOG_LEVEL
Specify logging level, default is INFO.
--seed SEED Specify crawl seed url
--headers [HEADERS [HEADERS ...]]
Specify headers, e.g. 'User-Agent:iOS/10.3'
--cookies [COOKIES [COOKIES ...]]
Specify cookies, e.g. 'lang=en country:us'
--requests-limit REQUESTS_LIMIT
Specify requests limit for crawler, default rps.
--interval-limit INTERVAL_LIMIT
Specify limit interval, default 1 second.
--include [INCLUDE [INCLUDE ...]]
Urls include the snippets will be crawled recursively.
--exclude [EXCLUDE [EXCLUDE ...]]
Urls include the snippets will be skipped.
--workers WORKERS Specify concurrent workers number.
Examples
Basic usage.
$ requests_crawler --seed http://debugtalk.com
Crawl with headers and cookies.
$ requests_crawler --seed http://debugtalk.com --headers User-Agent:iOS/10.3 --cookies lang:en country:us
Crawl with 30 rps limitation.
$ requests_crawler --seed http://debugtalk.com --requests-limit 30
Crawl with 500 rpm limitation.
$ requests_crawler --seed http://debugtalk.com --requests-limit 500 --interval-limit 60
Crawl with extra hosts, e.g. httprunner.org will also be crawled recursively.
$ requests_crawler --seed http://debugtalk.com --include httprunner.org
Skip excluded url snippets, e.g. urls include httprunner will be skipped.
$ requests_crawler --seed http://debugtalk.com --exclude httprunner
Metadata
Release files for requests-crawler 0.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| requests-crawler-0.5.4.tar.gz | 11.3 kB | Without provenance | Details for requests-crawler-0.5.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| requests_crawler-0.5.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for requests_crawler-0.5.4-py2.py3-none-any.whl |
Total release size: 31.9 kB
Release files / requests-crawler-0.5.4.tar.gz
| Download URL | requests-crawler-0.5.4.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa4e14bc0c2d203765747266b8836e487aa777d86dc0bd34972c7f8cdae098e3
|
|
BLAKE2b-256 checksum How to use checksums |
612ace5aa0db4a6d81e27d8676be7734399cf986fda0401f12b220a9fba63785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / requests_crawler-0.5.4-py2.py3-none-any.whl
| Download URL | requests_crawler-0.5.4-py2.py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e2b557e8fdfa5e66ccbea8ce7baf7424cc6d4b3582375963b1fee1b23e47a297
|
|
BLAKE2b-256 checksum How to use checksums |
7db7c73ab226be33a1e1788f8b5165b700f7557266354f6db7619494c9267e6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for requests-crawler 0.5.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.