Skip to main content

Basic Web Scraper made with selenium and bs4

Project description

Basic Web Scraper

Project Description

This package can be used for simple automated web surfing / scraping.

Create classes inheriting the included BasicSpider class to create custom behavior to suit your requirements.


Usage Example

from basic_web_scraper.BasicSpider import BasicSpider

class CustomSpider(BasicSpider):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def custom_operation(self, threshold):
        """
        Scroll to predefined threshold.
        If past threshold, scroll back up.
        """
        if self.get_page_y_offset() < threshold:
            self.mousewheel_vscroll(number_of_scrolls=2)

        else:
            y_difference = self.get_page_y_offset() - threshold
            self.smooth_vscroll_up_by(y_difference)

More Description

Driver

In order for the package to work, you must include a geckodriver.exe in your local project directory. Otherwise a GeckoNotFoundException will be raised

Note: This package currently only supports working with The Firefox geckodriver, which can be downloaded from here

BasicSpider.py

Use this as the superclass for your own project's spider

This Spider allows you to do basic things like goto a url, scroll down the page in different ways, refresh the page, etc..

It acts as an interface to selenium.webdriver to make setting up a project easier

More docs will be added in the future.

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

basic-web-scraper-0.13.7.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

basic_web_scraper-0.13.7-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file basic-web-scraper-0.13.7.tar.gz.

File metadata

  • Download URL: basic-web-scraper-0.13.7.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for basic-web-scraper-0.13.7.tar.gz
Algorithm Hash digest
SHA256 e629e35f244b908b86efd2a34a2131461c17204576c9a865e5cbfa928984d0ff
MD5 b89c18466f72ead6fa0208152232818d
BLAKE2b-256 5ea8533865cb6295c3ee0626d2483ed1e5dfbc6caa16fa60bb32bb3d61889a8a

See more details on using hashes here.

File details

Details for the file basic_web_scraper-0.13.7-py3-none-any.whl.

File metadata

  • Download URL: basic_web_scraper-0.13.7-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for basic_web_scraper-0.13.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1b8e77c92398b953101735440156c7a470c19d94ee28a431d5da5e194ffa8841
MD5 1fd3e02b542030ab738ba6b18f40508d
BLAKE2b-256 f03dc9768d9504fa05a2f29f8f6c6aa5106cccbcca9e4e8357d501674594db23

See more details on using hashes here.

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