Last active
May 26, 2016 17:25
-
-
Save nithyadurai87/99827ac397733358d81334ca72b327d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
a = webdriver.Firefox() | |
a.get("http://magento-demo.lexiconn.com/") | |
a.maximize_window() | |
a.find_element_by_xpath("//input[@id='search']").send_keys("Bed & Bath") | |
a.find_element_by_xpath("//button[@title='Search']").click() | |
lis = a.find_elements_by_xpath("//h2[@class='product-name'] / a ") | |
print str(len(lis)) + " products found" | |
for i in lis: | |
print i.text | |
a.quit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment