快速说明
简介
BaseCrawler是一个轻量级,简单快捷上手操作基础爬虫工具库,对于爬虫开发者,有很多实用的功能已经进行了优化与完善。 BaseCrawler帮你处理各种类型怪异的url拼接错误问题,以及各种不同格式的时间,有很多小功能帮你解决头疼的问题。 API说明文档请访问:http://www.basecrawler.com 具体使用请查看文档 QQ交流群:662500882
版本支持
* Python 2.7.x
* Python 3.x
* 如python3发现Bug,请与我联系!
安装说明
PIP 安装
``pip install basecrawler``
使用说明——方式一
首先我们引入BaseCrawler ::
from basecrawler import BaseCrawler
声明一个url地址, 例如: ::
url = http://www.baidu.com
实例化一个BaseCrawler对象 ::
basecrawler = BaseCrawler()
通过basecrawler请求目标url ::
response = basecrawler.requests_get(url)
``response`` 是requests.Response对象,输出返回的结果内容 ::
print response.text
使用说明——方式二
如果我们采用面创建类的方式实现,可以直接继承 BaseCrawler ::
from basecrawler import BaseCrawler
class Crawler(BaseCrawler):
# 定义你自己的类方法
def foo():
pass
if __name__ == "__main__":
crawler = Crawler()
url = http://www.baidu.com
crawler.requests_get(url)
支持反反爬
* 目前完成基础反反爬处理, 根据反反爬策略可以选择不同的处理方式
* 常见反爬的东西,大家就不要再自己码代码了,这里我进行处理了!
*
支持动态网页爬取
* 支持处理JS加载数据处理, 同时完成对 Phantomjs 性能优化
* 想必大家在使用selenium中的PhantomsJS 时一定非常消耗性能哦,这里我已经完成性能优化,让它飞起来!
支持代理
* 支持 ``requests`` 及 ``phantomjs`` 代理
* requests的代理可能大部分小伙伴都会加(如果不会,我这里也有哦)
* PhantomJS不会使用代理的快来用吧!这里都给你做好了!
支持翻页处理
* 实现web网站翻页处理, 按API格式设置,可自动完成翻页处理
支持自动获取免费代理
* basecrawler内含获取代理IP方法,单次调用提供100个免费IP, 因验证ip会加大代理负载,IP不做验证处理,即时即用
支持图片下载与替换
* 支持将目标图片下载到OSS服务中
支持自动修复iframe视频地址
* HTML中存在iframe视频,不能正常播放的,已经完成处理。
取消支持微信
* 取消微信支持
Metadata
Release files for basecrawler 0.1.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| basecrawler-0.1.20-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for basecrawler-0.1.20-py2.py3-none-any.whl |
Release files / basecrawler-0.1.20-py2.py3-none-any.whl
| Download URL | basecrawler-0.1.20-py2.py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
da1be56956be5e35717d64ccdf18aa48ea4d1057735595f105c9f79333b443b7
|
|
BLAKE2b-256 checksum How to use checksums |
d9679890fb9a5420a660fd6c0784fb0719a309110a4e279f03e6de8ad57489aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.16
|
Security for basecrawler 0.1.20
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.