Usage

Installation

To use pyselenscrapr, you need to install it first.

(.venv) $ pip install pyselenscrapr

Creating a Bot

To start a new bot, you need to create a new instance of the pyselenscrapr.ScrapingBot class. You pass the Selenium driver to the constructor.

pyselenscrapr.ScrapingBot.ScrapingBot.run(self, first_group: str | ScrapingStepGroup | None = None)

Run the bot and execute all steps in the defined groups.

Parameters:

first_group – This is the name of the first group to start. If it is None we use “default” as the first group.

Returns:

True if the bot finished successfully, False otherwise.

For example:

from pyselenscrapr.ScrapingBot import ScrapingBot, TakeScreenshotModes

bot = ScrapingBot(driver)

... Add your steps here ...

bot.run()

bot.get_data('your_saved_data')