elcrawlsdk-1.0.0
توضیحات
Python SDK for elcrawl
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | elcrawlsdk-1.0.0 |
| نام | elcrawlsdk |
| نسخه کتابخانه | 1.0.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | jf |
| ایمیل نویسنده | jf@163.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/elcrawlsdk/ |
| مجوز | BSD-3-Clause |
# SDK for Python
The SDK for Python contains two parts:
1. CLI Tool
2. Utility Tools
## CLI Tool
The CLI Tool is mainly designed for those who are more comfortable using command line tools.
The installation of the CLI Tool is:pip install elcrawlsdk
Then, you can use the `elcrawl` command in the command prompt. elcrawl --help
## Utility Tools
Utility tools mainly provide some `helper` methods to make it easier for you to integrate your spiders into platform, e.g. saving results.
##### Scrapy Integration
In `settings.py` in your Scrapy project, find the variable named `ITEM_PIPELINES` (a `dict` variable). Add content below.
```python
ITEM_PIPELINES = {
'elcrawl.pipelines.ElcrawlMongoPipeline': 888,
}
```
Then, start the Scrapy spider. After it's done, you should be able to see scraped results in **Task Detail -> Result**
##### General Python Spider Integration
Please add below content to your spider files to save results.
```python
# import result saving method
from elcrawl import save_item
# this is a result record, must be dict type
result = {'name': 'elcrawl'}
# call result saving method
save_item(result)
```
Then, start the spider. After it's done, you should be able to see scraped results in **Task Detail -> Result**
نیازمندی
| مقدار | نام |
|---|---|
| ==7.0 | Click |
| ==2.22.0 | requests |
| ==0.7.2 | prettytable |
| ==2.2.0 | scrapy |
| ==3.10.1 | pymongo |
| ==0.9.3 | pymysql |
| ==2.8.5 | psycopg2-binary |
| ==2.0.1 | kafka-python |
| ==7.8.0 | elasticsearch |
| ==0.8.0 | pathspec |
نحوه نصب
نصب پکیج whl elcrawlsdk-1.0.0:
pip install elcrawlsdk-1.0.0.whl
نصب پکیج tar.gz elcrawlsdk-1.0.0:
pip install elcrawlsdk-1.0.0.tar.gz