Skip to main content

😁 Welcome!!

Contents

🌐 Dynamic Web Scraper

💻 Windows and Linux compatible. 💻

This is a dynamic web scraper specifically designed for websites that have to wait for certain elements to load (such as AngularJS). It runs at specified time intervals. This can be used to monitor when a new element is added to the website instead of having to manually refresh it.

Instead of looking at the source, it waits until all elements are loaded to retrieve the results by using selenium and a Firefox driver.

Whenever a new element is discovered, it will notify you and save it to a file so that it doesn't notify you again for that same element in the future.

🚀 Quick start

pipx install dynamic-scraper
dynamic-scraper -u "https://www.example.com" -s "search this text"

💡 Use case examples

This is useful, for example to notify you when a certain keyword is found on a website, such as:

  • New job on a job board
  • New product on an online store
  • New article on a blog post
  • ...

✨ Features

  • Automated Scraping: Runs at user-defined intervals, extracting data without manual input.
  • Notification System: Notifies users via Windows notifications when new data is found.
  • Robust Parsing: Utilizes customizable search strings and regular expressions for data extraction.

📦 Installation

(Go below for manual installation.)

From PyPI

pipx is optional but recommended, you can use pip instead.

pipx:

pipx install dynamic-scraper

pip:

pip install dynamic-scraper

You can also clone the repository and install:

git clone https://github.com/P-ict0/Dynamic-Web-Scraper.git
cd Dynamic-Web-Scraper
pipx install .

📲 Usage

For help:

dynamic-scraper --help

General usage:

dynamic-scraper -u "https://www.example.com" -s "search this text"

Also see common errors if you encounter any issues with the browser.

⚙ Options

Option Short Form Requirement Default Description
--url -u Required None The URL of the webpage from which to fetch data.
--search-string -s Required None The string you want to search for within the webpage.
--version -V Optional None Get current version
--regex -r Optional search_string The regular expression pattern used to store the results nicely.
--interval -i Optional 5 The interval in minutes at which the script should run repeatedly.
--json_path -j Optional Windows: %APPDATA%/Roaming/Dynamic-Scraper/results.json
Linux: $HOME/.dynamic_scraper_results.json
The file path where the found results will be saved as JSON.
--use-previous -p Optional False Use results from previous runs, if present.
--no-headless None Optional False Disable headless mode for the webdriver and run maximized.
--verbose -v, -vv Optional None (threshold: WARNING) Increase verbosity level (-v, -vv, etc.). INFO for -v, DEBUG for -vv.
--quiet -q Optional False Suppress all notifications, only get output in the console.
--locator-type -t Optional xpath Type of locator to wait for the element to load. Options include various HTML attribute types.
--locator-value -l Optional //section[@class='list-item ng-scope'] Value of the locator to search for.

✏ Manual Installation

git clone https://github.com/P-ict0/AngularJS-Dynamic-Web-Scraper.git

Recommended to use a virtual environment:

python3 -m venv venv

source venv/bin/activate  # Linux
venv\Scripts\activate  # Windows
pip install -r requirements.txt

You can now run:

python src/web_scraper/scraper.py [args]

❌ Common errors

You may also need to install the latest geckodriver from here and add it to your PATH.

👥 Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your suggested changes.

Metadata

Release files for dynamic-scraper 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dynamic-scraper 1.1.1
File Size Uploaded
dynamic_scraper-1.1.1.tar.gz 48.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dynamic-scraper 1.1.1
File Interpreter ABI Platform
dynamic_scraper-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 85.9 kB

Release files / dynamic_scraper-1.1.1.tar.gz

Download URL dynamic_scraper-1.1.1.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
96347ce4a3bd92088c30d5a55bd3581c1856ff31a5987943d10b63d292b78e45
BLAKE2b-256 checksum
How to use checksums
029c435026a1cc5a624943ea03f8993c88d897ae7ec773952afbaf2cdfeeb3fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / dynamic_scraper-1.1.1-py3-none-any.whl

Download URL dynamic_scraper-1.1.1-py3-none-any.whl
Size 37.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e8669187f9fd576f37ee4100c46748cc21e9e9982919371541774eac77e99f0
BLAKE2b-256 checksum
How to use checksums
3f354a32b41e17f8619bbf87fd8e27176eaffb6b62a19bf6dcb79468c99869b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page