一个分布式异步爬虫
Project description
# Dcrawl(这次不装逼,用中文)
一个分布式异步爬虫,采用生产Producer和消费Consumer模式
# producer_demo
from producer import Producer
p = Producer()
data = {
"name": 'baidu',
"url": "https://baidu.com",
"headers": {"Content-Type": "application/json"},
"data": {},
"method": "get"
}
p.add_task(data)
p.run()
# consumer_demo
from consumer import Consumer
cons = Consumer()
# 数据处理方法 todo 可以根据不同的name写不同的handle
@Consumer.handle
def result(resp):
print('test')
print(resp)
cons.loop_task()
一个分布式异步爬虫,采用生产Producer和消费Consumer模式
# producer_demo
from producer import Producer
p = Producer()
data = {
"name": 'baidu',
"url": "https://baidu.com",
"headers": {"Content-Type": "application/json"},
"data": {},
"method": "get"
}
p.add_task(data)
p.run()
# consumer_demo
from consumer import Consumer
cons = Consumer()
# 数据处理方法 todo 可以根据不同的name写不同的handle
@Consumer.handle
def result(resp):
print('test')
print(resp)
cons.loop_task()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chuwt_Dcrawl-0.1.1.tar.gz
(1.6 kB
view details)
File details
Details for the file chuwt_Dcrawl-0.1.1.tar.gz.
File metadata
- Download URL: chuwt_Dcrawl-0.1.1.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7cbdf27747c008836cb8ae95c2dc91cf0cb0fb52a6497cfc77792c778a59530
|
|
| MD5 |
1186b3c89a3cf8426303ce6d95925e94
|
|
| BLAKE2b-256 |
afb0cb9609c6af99ae941a6520af9becdc90fc9cf0d312a3c2e3f9c71fa8dc6b
|