jiuqian-scrapy-pipelines
Reusable Scrapy pipeline for counting items and sending a completion message to a WeCom bot.
Install
pip install jiuqian-scrapy-pipelines
Configure
Set the WeCom bot webhook:
WECHAT_WORK_WEBHOOK=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...
Register the pipeline in Scrapy settings:
ITEM_PIPELINES = {
"jiuqian_scrapy_pipelines.pipelines.ItemCountWeComPipeline": 400,
}
create main.py
crate .env file
WECHAT_WORK_WEBHOOK=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...
from scrapy.cmdline import execute
import os
from pathlib import Path
from dotenv import load_dotenv
# settings.py 的上一级目录是包目录,再上一级是项目根目录
BASE_DIR = Path(__file__).resolve().parent
load_dotenv(BASE_DIR / ".env")
dirpath = os.path.dirname(os.path.abspath(__file__))
os.chdir(dirpath)
execute(['scrapy', 'crawl', 'spider'])
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrapy_pipeline_all-0.1.2.tar.gz.
File metadata
- Download URL: scrapy_pipeline_all-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb8ad2e9556265b769ecce2a22283b0d5a15e00b1a0cbd8d2bfc5d55883da4da
|
|
| MD5 |
363f39343c0bfb1ee0d3f29e38653445
|
|
| BLAKE2b-256 |
b99f70e28753d0972283fe383e38c6c340e3381b4e03c27cce2252c996aefde2
|
File details
Details for the file scrapy_pipeline_all-0.1.2-py3-none-any.whl.
File metadata
- Download URL: scrapy_pipeline_all-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e70e1f171b23b157c680b2e6c2403c9a828716783a9becc66ea5d33c6d0363cc
|
|
| MD5 |
5323a5c859c4563965f8610abff942a9
|
|
| BLAKE2b-256 |
368e62e109ea62ffa1ecdba561652ba289272eb5c1e431b97c4afd3c6ac52c3b
|