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
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
Built Distribution
Hashes for basic-web-scraper-0.13.5a2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cac5e9d061d55ee8cbb6368b0dd2f7ffe2e96c4f3966917ae47269eaa3bb27ab |
|
MD5 | d2ea9e71e7c9660bb224c7bad38ab94f |
|
BLAKE2b-256 | 5e75fd82020c8419bfa9f92b9f3777ad16a23b7bdeda4ad3a1ffbbb19ba82632 |
Hashes for basic_web_scraper-0.13.5a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3434d68910ed979fde653acbefac8fc804e5a682c43805ff62458afa73eedee6 |
|
MD5 | 1c55db943ee7a14287c95ce3bb1fd923 |
|
BLAKE2b-256 | 8db1ef3f84c1e0f44052f5c1dc0d526b7920726c96085bbf389b67202b24c4a5 |