scrapy util
Project description
Scrapy Spider
启用数据收集功能
此功能配合spider-admin-pro 使用
# 项目名默认是(不需要设置)
BOT_NAME = 'scrapy_demo'
# 设置收集运行日志的路径,会以post方式提交json数据
STATS_COLLECTION_URL = "http://127.0.0.1:5001/api/collection"
使用脚本Spider
# -*- coding: utf-8 -*-
from scrapy import cmdline
from scrapy_util.spiders import ScriptSpider
class BaiduScriptSpider(ScriptSpider):
name = 'baidu_script'
def execute(self):
print("hi")
if __name__ == '__main__':
cmdline.execute('scrapy crawl baidu_script'.split())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scrapy-util-0.0.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for scrapy_util-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b43e6abbd5eaef4000243cda782113107ccddc5233f3ea834ae63d582d2cabe |
|
MD5 | 5be68362f739c43b69895a7d64fd123e |
|
BLAKE2b-256 | 34f5041fd441004693463261f0ee3728eb346f240e7f8192e7734adac564365a |