css for locate, bs for parse, as easy as possible
Project description
auto_spider
css for locate, bs for parse, as easy as possible
install
pip install autospider
example
- demo
from auto_spider import auto_local_spider, get_text, a_dict_list, table2dict
urls = ['https://tag.120ask.com/jibing/naotan/bingyin/',
'https://tag.120ask.com/jibing/naoshuansai/bingyin/']
viewer = {
'name': {'selector': 'body > div.m1200 > div.top_dl > b', 'func': get_text},
'related': {'selector': '#yw0 > div > div.baike_dl > div', 'func': a_dict_list}
}
res = auto_local_spider(urls, viewer)
res[0]
[{'name': 'xxx',
'related': [{'href': 'http://tag.120ask.com/jibing/nxthzhz/','title': 'yyy'}],
'url': 'https://tag.120ask.com/jibing/naotan/bingyin/'},
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size autospider-0.0.4-py3-none-any.whl (5.1 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size autospider-0.0.4.tar.gz (3.9 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for autospider-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56047de5ae27b7cea5ac7bdffe8874a40d8a286f22f167a1c705cd224af6d8ee |
|
MD5 | 48dd526e1e1d89a45cf0fdc036b47903 |
|
BLAKE2-256 | 226a78d88e115c0fce143d7458f043a5518e178061a7e587b8ad9c4b862015c9 |