Skip to main content

WrapperXSelector is an intuitive tool that empowers users to effortlessly create scraping wrappers. Seamlessly combining the art of crafting with powerful scraping capabilities, it allows users to select and store XPath configurations for later use in efficient website data harvesting.

Project description

WrapperXSelector

WrapperXSelector is a tool that simplifies the process of generating web scraping wrappers for Selenium-loaded HTML pages. It provides an interactive user interface for users to select and define the elements they want to scrape on a website, and then generates corresponding Selenium XPath selectors for automation.

Features

  • User-Friendly Interface: WrapperXSelector offers a user-friendly interface for selecting and defining elements on a Selenium-loaded HTML page.
  • XPath Generation: Automatically generates XPath selectors based on user-defined elements for web scraping automation.
  • Dynamic Wrapping: Supports dynamic websites by allowing users to interact with elements before generating the wrapper.

How It Works

  1. Setup: Start by providing the URL of the Selenium-loaded HTML page you want to scrape.
  2. Interactive Selection: Use the interactive interface to click and select elements on the page that you want to scrape.
  3. XPath Generation: WrapperXSelector dynamically generates XPath selectors for the selected elements.
  4. Wrapper Output: Outputs the generated wrapper in JSON format, ready to be used for web scraping automation.

Usage

from WrapperXSelector import generateWrapper

# Provide the wrapper name, URL, and optional repeated pattern parameter
wrapper_name = "example_wrapper"
url = "https://example.com"
repeated_pattern = "yes"  # Set to "yes" if the pattern repeats, otherwise omit or set to "no"

# Generate the wrapper
wrapper_file = generateWrapper(wrapper_name, url, repeated_pattern)
print(f"Wrapper generated and saved to {wrapper_file}")

pip install WrapperXSelector

**Dependencies:**

- [Selenium](https://pypi.org/project/selenium/)
- [ChromeDriver](https://pypi.org/project/webdriver-manager/)


## License

**MIT License.** See [LICENSE](LICENSE) for details.

## Disclaimer

Intended for educational and legal use only. Users must comply with the terms of service of scraped websites and applicable laws and regulations.

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

WrapperXSelector-0.1.14.tar.gz (44.3 kB view hashes)

Uploaded Source

Built Distribution

WrapperXSelector-0.1.14-py3-none-any.whl (45.9 kB view hashes)

Uploaded Python 3

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