Skip to main content

魔改使用工具库

Project description

安装

可以直接输入以下命令:

   pip install gzspidertools

可选安装1,安装数据库相关的所有依赖:

.. code:: bash

pip install gzspidertools[database]


可选安装2,通过以下命令安装所有依赖:

.. code:: bash

pip install gzspidertools[all]

注:详细的安装介绍请查看 安装指南_。

用法

开发人员只需根据命令生成示例模板,再配置相关设置即可。

用法 ::

查看库版本

gzcmd version

创建项目

gzcmd startproject <project_name>

进入项目根目录

cd <project_name>

替换(覆盖)为真实的配置 .conf 文件:

这里是为了演示方便,正常情况是直接在 VIT 中的 .conf 文件填上你需要的配置即可

cp /root/mytemp/.conf DemoSpider/VIT/.conf

生成爬虫脚本

gzcmd genspider <spider_name> <example.com>

运行脚本

scrapy crawl <spider_name>

注:也可以使用 gzcmd crawl <spider_name>

跑通测试

前提:需要在 tests 的 VIT 目录下创建 .conf 文件,已给出示例文件,请填写测试所需内容,然后:

  • 可以直接使用 tox 来运行测试。
  • 本库以 poetry_ 开发,那么直接新环境下运行 poetry install 后,手动运行目标测试或 pytest 命令来测
    试等皆可。
  • 也可以使用 make 工具,make start 然后 make test 即可。

Project details


Download files

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

Source Distribution

gzspidertools-0.0.27.tar.gz (87.1 kB view details)

Uploaded Source

Built Distribution

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

gzspidertools-0.0.27-py3-none-any.whl (126.2 kB view details)

Uploaded Python 3

File details

Details for the file gzspidertools-0.0.27.tar.gz.

File metadata

  • Download URL: gzspidertools-0.0.27.tar.gz
  • Upload date:
  • Size: 87.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10

File hashes

Hashes for gzspidertools-0.0.27.tar.gz
Algorithm Hash digest
SHA256 9e687a8f94a84c5d518b5d4a9e6f3efe3176e657f1050719dd0ad7ab752ee8f4
MD5 bb4e762d6c7939ba045c3c3d9e584189
BLAKE2b-256 a97756e8e34d645c3cd1b3291489eb225e9c640655e3650589f5989a960eb0e9

See more details on using hashes here.

File details

Details for the file gzspidertools-0.0.27-py3-none-any.whl.

File metadata

  • Download URL: gzspidertools-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 126.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10

File hashes

Hashes for gzspidertools-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 6a98496472fee8449077679f06b6bc113f7a45436e76b1b6eb646639af395de9
MD5 34bdab1b127e921e71892959bdec9529
BLAKE2b-256 cccdebb9bceaedb4ac50a3bdac7756efddeb54accc88a266401eb96eeacbbf9f

See more details on using hashes here.

Supported by

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