Scrapy-Splash 项目教程

Scrapy-Splash 项目教程

scrapy-splashScrapy+Splash for JavaScript integration项目地址:https://gitcode.com/gh_mirrors/sc/scrapy-splash

1. 项目的目录结构及介绍

Scrapy-Splash 项目的目录结构如下:

scrapy-splash/
├── scrapy_splash/
│   ├── __init__.py
│   ├── dupefilter.py
│   ├── middleware.py
│   ├── request.py
│   ├── response.py
│   ├── __pycache__/
│   └── utils.py
├── tests/
│   ├── __init__.py
│   ├── test_dupefilter.py
│   ├── test_middleware.py
│   ├── test_request.py
│   ├── test_response.py
│   └── test_utils.py
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
└── setup.py

目录结构介绍

  • scrapy_splash/: 包含 Scrapy-Splash 的核心代码文件。
    • __init__.py: 初始化文件。
    • dupefilter.py: 去重过滤器。
    • middleware.py: 中间件。
    • request.py: 请求处理。
    • response.py: 响应处理。
    • utils.py: 工具函数。
  • tests/: 包含测试文件。
    • __init__.py: 初始化文件。
    • test_dupefilter.py: 去重过滤器测试。
    • test_middleware.py: 中间件测试。
    • test_request.py: 请求处理测试。
    • test_response.py: 响应处理测试。
    • test_utils.py: 工具函数测试。
  • .gitignore: Git 忽略文件。
  • LICENSE: 许可证文件。
  • README.md: 项目说明文档。
  • requirements.txt: 依赖包列表。
  • setup.py: 安装脚本。

2. 项目的启动文件介绍

Scrapy-Splash 项目的启动文件主要是 setup.py。该文件用于安装 Scrapy-Splash 库。

setup.py 文件介绍

setup.py 文件内容如下:

from setuptools import setup, find_packages

setup(
    name='scrapy-splash',
    version='0.7.2',
    description='Scrapy+Splash for JavaScript integration',
    long_description=open('README.md').read(),
    long_description_content_type='text/markdown',
    author='Scrapinghub',
    author_email='info@scrapinghub.com',
    url='https://github.com/scrapy-plugins/scrapy-splash',
    license='BSD',
    packages=find_packages(exclude=['tests']),
    install_requires=[
        'scrapy>=1.0',
        'Twisted>=16.0',
        'requests>=2.17',
    ],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'License :: OSI Approved :: BSD License',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Framework :: Scrapy',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)

启动文件介绍

  • name: 项目名称。
  • version: 项目版本。
  • description: 项目描述。
  • long_description: 详细描述,通常从 README.md 文件读取。
  • author: 作者。
  • author_email: 作者邮箱。
  • url: 项目主页。
  • license: 许可证。
  • packages: 包含的包。
  • install_requires: 依赖包列表。

scrapy-splashScrapy+Splash for JavaScript integration项目地址:https://gitcode.com/gh_mirrors/sc/scrapy-splash

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

郭蔷意Ward

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值