a spider bot (scrawler) by python, using selenium and chrome driver
Project description
spiderbot
a spider bot, published as module spiderbot.
How to use?
Install
pip install spiderbot
install chrome browser and chromedriver, and put chromedrive binary into the PATH dir.
Config
Init the config_private.py, using config_private_sample.py as example, and update the value of XPATHS
and DB_NAME
arguments.
or,
When Generating an instance of SpiderBot, pass the value of xpaths
and db_name
arguments.
Run it
Init the database by pass the init=True
to Generate an instance of SpiderBot. If successed, spiderbot.db
was created.
from spiderbot import SpiderBot
bot = SpiderBot(skip_driver=True, init=True)
Then add users to scrawler. You can add users always as needed.
from spiderbot import SpiderBot
urls = ["https://example.com/user_a_homepage", "https://example.com/user_b_homepage"]
bot = SpiderBot()
bot.add_users(working_status=True, *urls)
At last, do the main job:
from spiderbot import SpiderBot
bot = SpiderBot()
bot.get_profiles()
bot.get_new_posturls()
bot.get_history_posturls(1, 9)
bot.get_posts()
bot.quit()
Code Format
isort .
black .
pylint spiderbot > pylint_spiderbot.log
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
spiderbot-0.2.2.tar.gz
(20.8 kB
view hashes)
Built Distribution
spiderbot-0.2.2-py3-none-any.whl
(22.5 kB
view hashes)
Close
Hashes for spiderbot-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6d4b2e0a3a7b22b3b4f19f2d963282ca520eb2c8e6cb5444cf2b0d0d992df78 |
|
MD5 | 0eb63741f56bc1061b3b5006c39af2ef |
|
BLAKE2b-256 | 14e15e9bf2d3d9a2f242944e631f780f1c2d3875d6d9121348e5f98efeaaf869 |