Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for autospider, version 0.0.4
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

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page