重推失败的 url 回到 redis 的小工具
必须:
1. 爬虫多次重试失败的 url 放入 mongodb
2. mongodb 内失败 url 的 key 为 "url",即 {"url": "www.xxx.com"}
3. 爬虫设置可以使用 redis 的 start_urls
安装:
# 看具体版本,包在 dist 文件夹下
$ pip install pushurls.tar.gz
使用:
# 直接开始:
$ pushurls
# 指定配置文件:
$ pushurls /root/push_fail_urls_set.json
配置文件格式:(建议直接运行,让程序自动生成配置文件,下次就不必再输入配置)
{"from": [
{
"adder_sep": ">>>",
"condition": {},
"db": "test_db",
"from_collection": "test_data",
"fromdb_str": "127.0.0.1.amazon.test_data",
"host": "127.0.0.1",
"password": "123456",
"port": 27017,
"source": "admin",
"url_head": "",
"url_tail": "**-fixed-**test_url",
"user": "root"
}],
"to": [
{
"db": "0",
"host": "127.0.0.1",
"port": 6379,
"spiders": {
"spider_name1": "S1:start_urls",
"spider_name2": "S2:start_urls"
},
"todb_str": "127.0.0.1:6379.0"
}]}
Metadata
Release files for pushurls 0.0.3
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 |
|---|---|---|---|---|
| pushurls-0.0.3.tar.gz | 6.6 kB | Without provenance | Details for pushurls-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pushurls-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for pushurls-0.0.3-py3-none-any.whl |
Total release size: 14.6 kB
Release files / pushurls-0.0.3.tar.gz
| Download URL | pushurls-0.0.3.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e93e475a083f338c64e533d956f92aeb3b3cb6018d5ddab30daf5ffcdadafda6
|
|
BLAKE2b-256 checksum How to use checksums |
279bd32f5e758b9dcd8ff3340551e7eb82deb259a6fe02ee8a1d8c9968d43306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
|
Release files / pushurls-0.0.3-py3-none-any.whl
| Download URL | pushurls-0.0.3-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25b642d017b71a49d476082717ebbfac999808fee1aba23fd55948990b63a221
|
|
BLAKE2b-256 checksum How to use checksums |
ba85c5041d67c4f4bad9a7d547cf3b3f41c7efba084d69ae4741c27efbc21932
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
|
Security for pushurls 0.0.3
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.