Creates a simple Selenium Webdriver, optimized for web scraping.
Project description
Selenium Crawler
A simple, opinionated Selenium WebDriver setup optimized for web scraping with Chrome. Designed for quick, lightweight data extraction, especially in Dockerized environments.
Features
- Chrome WebDriver configuration for scraping
- Headless mode and image loading control
- Optimizations for Docker, Windows, Linux, and MacOS
- Utilities for element selection and waiting
Requirements
- Google Chrome browser
- ChromeDriver (compatible with your Chrome version)
Usage
Import and use the WebDriver creator and scraping tools in your scripts:
from selenium_crawler.webdrivercreator import create_webdriver
from selenium_crawler.scraping_tools import get_element
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
driver = create_webdriver(headless=True)
try:
driver.get('https://example.com')
element = get_element(driver, (By.XPATH, '//h1'), timeout=10)
print(element.text)
except TimeoutException:
print('Element not found within the timeout period.')
finally:
driver.quit()
Testing
Run all tests with:
make test
Or manually:
python -m unittest discover -s tests -v
Notes
- This project is not intended to bypass all bot detection mechanisms.
- Focuses on ease of use and quick setup for scraping tasks.
- For advanced anti-bot evasion, consider additional tools or services.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file selenium_crawler-0.1.0.tar.gz.
File metadata
- Download URL: selenium_crawler-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10b21cd32312a6573e736fa16feb0c4fbd8d7a32168569a862539bc6c454ecd3
|
|
| MD5 |
3be05c3733a69a437bd2f0d67c22b605
|
|
| BLAKE2b-256 |
a64ca442cea4088f90db2b6d7ed235c1864f1c880f8c7035bcc028cc5e008f0e
|
File details
Details for the file selenium_crawler-0.1.0-py3-none-any.whl.
File metadata
- Download URL: selenium_crawler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fac9fae7a45a7d58d31572aaf517d894a11d577dbd769b46b80d06d60fcb09af
|
|
| MD5 |
56c372734c92c6f3bb11dd6af8719bd6
|
|
| BLAKE2b-256 |
38bb49f9bfb3391fbe01c393c0c559a8a078e9cadf85c927058494c9173f2fd4
|