Skip to main content

Py-Easy-Scrap

Description

A useful package for web scraping with Selenium

Installation

pip install py-easy-scrap

Requirements

  • Python 3.7 or higher
  • Selenium, along with GeckoDriver (Firefox)

Usage

In your project directory, create a new directory for your logs - it can be just called 'logs':

mkdir logs

Then, import the package:

import pyeasyscrap as pes

Get WebDriver

driver = pes.get_webdriver(headless)

This will return an instance of webdriver.Firefox (GeckoDriver).

Get Element

element = pes.get_element(driver, value="element_xpath")

This will return the web element found using the specified driver and value. By default, this function uses 'XPATH' as the method of searching. However, you can change this by providing 'ID' or 'LINK_TEXT' as the 'by' argument.

Please be aware that the method of searching ('XPATH', 'ID', or 'LINK_TEXT') highly depends on the webpage structure. Therefore, it is essential to inspect the webpage beforehand.

Also, please remember to replace "element_xpath" with the actual Xpath, ID, or link text of the element you want to find.

Scroll to Element

pes.scroll_to(driver, element)

This will use JavaScript to scroll the view of the given webdriver to the specified web element.

Ask for Data

required_data = ("username", "password")
file_name_no_extension = "user_credentials"
pes.ask_for_data(required_data, file_name_no_extension)

This will return a dictionary containing the collected data and will create a JSON configuration (.conf) file.

Check File

pes.check_file("path_to_file")

This will return either True or False based on file existence

Please note that the above code snippets are basic examples of how to use those functions. Depending on the exact specifications of your use case, additional setup may be necessary (e.g. logging into a website before trying to scroll to an element).

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Metadata

Release files for py-easy-scrap 0.1.3

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

Source distribution (sdist)

Source distribution for py-easy-scrap 0.1.3
File Size Uploaded Provenance Actions
py-easy-scrap-0.1.3.tar.gz 6.2 kB Without provenance Details for py-easy-scrap-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-easy-scrap 0.1.3
File Interpreter ABI Platform Actions
py_easy_scrap-0.1.3-py3-none-any.whl Python 3 none any Details for py_easy_scrap-0.1.3-py3-none-any.whl

Total release size: 13.1 kB

Release files / py-easy-scrap-0.1.3.tar.gz

Download URL py-easy-scrap-0.1.3.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a807c0a9e92c20b6b3df1e4c19790b59b41aee7ad16bcc343f464019f4ccf028
BLAKE2b-256 checksum
How to use checksums
79fe3b4fc4b9db011d5411b807c2aff4f5c3212a8a048fea448ecb1f0325db06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/6.6.0 pkginfo/1.9.6 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.16

Release files / py_easy_scrap-0.1.3-py3-none-any.whl

Download URL py_easy_scrap-0.1.3-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a53395fe32a3ebde5f9b8b780a0f9ea7043fdb3ec890022e45cf09b40d6796d2
BLAKE2b-256 checksum
How to use checksums
aa8bdfb6c2f565c0e7e5610630bc754e1243cf1a309eb4075466b5c2544594d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/6.6.0 pkginfo/1.9.6 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.16

Security for py-easy-scrap 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

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