Skip to main content

Boilerplate for developing crawler with Selenium.

Project description

Selenium Crawler Template

Boilerplate for developing crawler with Selenium.

Installation

pip install selenium-crawler-template

Usage

from selenium_crawler_template import Crawler

class MyCrawler(Crawler):
    @Crawler.open_url_in_new_tab
    def _get_email_from_profile(self, _):
        return self.find_element('a#email').get_attribute('href')

    def crawl(self, **kwargs):
        self.driver.get(kwargs['url'])

        for profile in self.find_elements('ul > .profile'):
            _ = self._get_email_from_profile(profile.get_attribute('href'))

        self._scroll_to_bottom()

Project details


Download files

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

Source Distribution

selenium-crawler-template-0.4.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

selenium_crawler_template-0.4.0-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page