Selenium Element Finder Library
Project description
Installation
pip install elements-manager
Import
from elements_manager import get_xpath
Example
Below script searches given keyword on google & scrapes result count
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from elements_manager import get_xpath
driver = webdriver.Chrome("chromedriver.exe")
# Open URL
driver.get('https://www.google.com/')
xpath=get_xpath(driver,'QYQyyPtidm5_xqG')
driver.find_element_by_xpath(xpath).click()
# Type in search bar
driver.switch_to.active_element.send_keys('shoes\n')
# Advanced method to scrape result count
xpath=get_xpath(driver,'z6XMV66vxokYpfn')
result_count=driver.find_element_by_xpath(xpath).text
print('result_count ',result_count)
driver.quit()
Contact Us
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file elements_manager-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: elements_manager-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2f7e1ad7f100617683b17097b2f237d3f6bd671f712352d8ba51622f0f2b24 |
|
MD5 | 92c1f0002a9cd04d85ce347b0eb080de |
|
BLAKE2b-256 | 4272ebf4790b4df22c06490c07e43df59172537daddfffa9eff0b19c689162e2 |