Skip to main content

爬虫的一些工具。

Project description

dtools

dtools 爬虫的一些工具库

安装

Required

pip install requests selenium

安装 download_tools

pip install download_tools

使用

下载文件

download_url()默认使用,也可以设置使用无头selenium,需要浏览器firefox和Firefox驱动

import download_tools as dt

page_souce = '<p>测试</p>' dt.download_str(page_souce, r'F:\test', name='测试', suffix='html')

dt.download_url('https://www.baidu.com', r'F:\test') 

headers

import download_tools as dt
dt.Headers().get()
dt.Headers(os='win', browser="chrome", headers=True).get()

for i in range(10):
    print(dt.Headers().get())

dtools.fake_headers fork from https://pypi.org/project/fake-headers/
修改:

  • generate()函数名修改为get()

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

download_tools-0.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

download_tools-0.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file download_tools-0.0.1.tar.gz.

File metadata

  • Download URL: download_tools-0.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for download_tools-0.0.1.tar.gz
Algorithm Hash digest
SHA256 80720856e7f644fd659142bebb809290e5ab0e9a9ad81dde9d4ae0bb0d6f7a40
MD5 613de720b367c0be2809728f099bdb01
BLAKE2b-256 020adb857010dafb14f1751996da9f9c66c2f880744398f15bf4edbc07b2f600

See more details on using hashes here.

File details

Details for the file download_tools-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: download_tools-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for download_tools-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3aadd7ae490caa311e96b04dd8fd32c634be15edd6e5cfbf5a9d1848022b3d20
MD5 99c82d03fcf4b390392243ab5faa964f
BLAKE2b-256 8423c47b3fc45f75b79bfbc81af25b484c4d33247645eb17e2b32d6d0b1b0914

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