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.26.tar.gz (86.9 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.26-py3-none-any.whl (126.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gzspidertools-0.0.26.tar.gz
  • Upload date:
  • Size: 86.9 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.26.tar.gz
Algorithm Hash digest
SHA256 0d14df86c1796e4cbfa23a8adba1b4e2c2dd6d980053719a67bb0b263cac36ce
MD5 0479234b81e2b58a5f50af844266929f
BLAKE2b-256 95ae3e35cfb55eb66492a034fdb27765d266b3131210c92dade6645afcefd660

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gzspidertools-0.0.26-py3-none-any.whl
  • Upload date:
  • Size: 126.0 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.26-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb23016fc5f6773b87e7a2dca9b842d299e2790104d783c7bdd53facacc7f97
MD5 195c961d34a6027b248396e63ebbd0a1
BLAKE2b-256 7b4c21f5b1879b33a61ff0bb9bef1468e14d459ff703f0c637d96f4def790166

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