Selenium Element Finder Library
Project description
Installation
pip install element-manager
Import
from element_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
driver = webdriver.Chrome("chromedriver.exe")
# Open URL
driver.get('https://www.google.com/')
xpath=get_xpath('QYQyyPtidm5_xqG')
driver.find_element_by_xpath(xpath)
# Type in search bar
driver.switch_to.active_element.send_keys('shoes\n')
# Advanced method to scrape result count
xpath=get_xpath('z6XMV66vxokYpfn')
result_count=driver.find_element_by_xpath(xpath).text
print('result_count ',result_count)
driver.quit()
Contact Us
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
element_manager-1.0.0.tar.gz
(9.0 kB
view hashes)