Skip to main content

tkitScrapyMongoPipeline

MongoPipeline

https://docs.scrapy.org/en/latest/topics/item-pipeline.html

数据存储到mongodb

# settings
import tkitScrapyMongoPipeline
# 1、设置MongoDB 的数据库地址
MONGO_URI = "mongodb://192.168.123.117:27017/"
MONGO_DATABASE="test"
# # 2、启用中间件MongoPipeline
ITEM_PIPELINES = {
   # 'base.pipelines.DuplicatesPipeline': 100,
   'base.pipelines.MongoPipeline': 100,
}








# item 字段示例
 item={
#设置强制去重复字段
"unique_id":url,
"title": title, "url": url, "content": text, "site": "playbarkrun.com", "content_type": "content",
# 设置表名
"collection_name":"test11"
}

详细参考

dev.md

Download files

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

Source Distribution

tkitScrapyMongoPipeline-0.0.0.116522771.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

tkitScrapyMongoPipeline-0.0.0.116522771-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file tkitScrapyMongoPipeline-0.0.0.116522771.tar.gz.

File metadata

File hashes

Hashes for tkitScrapyMongoPipeline-0.0.0.116522771.tar.gz
Algorithm Hash digest
SHA256 636e680a66e6c8c918c4bf92aa696d502eea6549e63c09cb0a0050fe48868845
MD5 0161dd2bed6d864a5e244630a013704c
BLAKE2b-256 286e8af1139d78732ad1140b67d8e635240c387ddad72120889f3b9ddb3be72c

See more details on using hashes here.

File details

Details for the file tkitScrapyMongoPipeline-0.0.0.116522771-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tkitScrapyMongoPipeline-0.0.0.116522771-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 85f4d08d7070374fda6a8e3edc264d8671e8abc61078ce4fb046747b468a9e87
MD5 86ecfcfb4289ed3fb70a8fd542fc0364
BLAKE2b-256 87ea2d4966b6a59a7670ddee701c2cc94e2b1cfea58cdd5c8f4a6f1d33de0400

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.0.116522771 This release

2 files

Supported by

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