Reputation: 56
I want to locate one of the specific elements on webpage. How to use
find_element_by_partial_link_text
to find out one of the following text "xxx" or "yyy"?
Example:
I need to find out one of "selenium" and "webdriver".
Using one command instead of following two:
element = driver.find_element_by_partial_link_text("selenium")
or
element = driver.find_element_by_partial_link_text("webdriver")
https://stackoverflow.com/search?q=webdriver
I try element = driver.find_element_by_partial_link_text(["selenium","webdriver"])
, but fail.
Upvotes: 1
Views: 56
Reputation: 4749
You can use like this in Google page , it is just a demo
driver = driver.Firefox()
driver.get("https://www.google.co.in/?gws_rd=ssl")
element = driver.find_element_by_partial_link_text("Gmail")
Upvotes: 1