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.

Additionally, the included BasicSpider class is meant to be extended by inheritance.


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 using instantiating the BasicSpider class will raise a GeckoNotFoundException

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 tu 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.5a1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basic_web_scraper-0.13.5a1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file basic-web-scraper-0.13.5a1.tar.gz.

File metadata

  • Download URL: basic-web-scraper-0.13.5a1.tar.gz
  • Upload date:
  • Size: 5.7 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.5a1.tar.gz
Algorithm Hash digest
SHA256 093c0eb4fd967b015f511a1fa91d12be186ae0d78fd483c153b81f4e91f7df74
MD5 9fdc640d2468d827a8c65ccaa54f4935
BLAKE2b-256 0ec4437e7772f4b6b19eb4043d620fe8f586db3f740fb5c2392d4353fb4a547f

See more details on using hashes here.

File details

Details for the file basic_web_scraper-0.13.5a1-py3-none-any.whl.

File metadata

  • Download URL: basic_web_scraper-0.13.5a1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.5a1-py3-none-any.whl
Algorithm Hash digest
SHA256 70a136ee135083db65dac814990c072151ca11cd6d1622086bb4d5827d7678f3
MD5 1fe12ca5593de932c1a345cb195c0ab8
BLAKE2b-256 d8ce5faeb52d27e3770f3bcd06887ab1e9617d8d4fd93dc8f5ccc5a75c4a5939

See more details on using hashes here.

Supported by

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