sense-text-extractor
sense-text-extractor是正文抽取客户端库
安装方式(当前版本0.0.1)
pip install sense-text-extractor
使用指南
基于sense-core的settings.ini的label配置调用:
from sense_text_extractor import SenseTextExtractor
extractor = SenseTextExtractor(label='text_extractor')
text = extractor.extract_text("http://sports.sina.com.cn/g/pl/2019-01-11/doc-ihqhqcis5048507.shtml", "穆里尼奥在等待复出")
print(text)
使用host和port的调用:
extractor = SenseTextExtractor('52.83.143.61', '6681')
text = extractor.extract_text("http://sports.sina.com.cn/g/pl/2019-01-11/doc-ihqhqcis5048507.shtml", "穆里尼奥在等待复出")
print(text)
使用说明
extract_text方法可能抛出异常,需要自己捕捉。返回结果是string,如果是''字符串,表示可能没有抽取出正文。 如果用于爬虫,extract_text需要传入第三个参数,也就是下载的html源码,否则extractor的sever端因为获取超时而抛出异常,也容易被反爬虫限制。
Metadata
Release files for sense-text-extractor 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sense-text-extractor-0.0.5.tar.gz | 4.8 kB | Without provenance | Details for sense-text-extractor-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sense_text_extractor-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for sense_text_extractor-0.0.5-py3-none-any.whl |
Total release size: 10.4 kB
Release files / sense-text-extractor-0.0.5.tar.gz
| Download URL | sense-text-extractor-0.0.5.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
571606f23643ec966c1018762eb4d78449b49fa02c420acbdc87bdeba602d17e
|
|
BLAKE2b-256 checksum How to use checksums |
623a124e936e99c571a4ce17c3bddd15118804d16478d128b1884b39eec1d0eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
|
Release files / sense_text_extractor-0.0.5-py3-none-any.whl
| Download URL | sense_text_extractor-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f41eeb1319668c2451d3a96e7f3f687990d0612e6cc49d30f42ee4bdc0b0cbb
|
|
BLAKE2b-256 checksum How to use checksums |
b6454eab1b89e332c85bffe4ce378f82e0eb5e4b21d398304a28e79c5ba0667a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
|
Security for sense-text-extractor 0.0.5
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.