0

I've few web links please let me know how I can visit their contact pages i've tried using but not working

contact_link = driver.find_element_by_partial_link_text('Contact')

and

driver.find_element_by_xpath('//a[contains(text(),"contact")]')

Every web page have different classes and different attributes so it is possible to do..

thanks

2
  • driverr.find_element_by_xpath["//a[contains(text(),contact')]"] this code will never work:) Please provide part of html code you want to use Commented Dec 8, 2015 at 12:07
  • I've multiple websites so I've the only solution if link_text work Commented Dec 8, 2015 at 12:14

2 Answers 2

1

Try this one on each page (each site homepage) driver.find_element_by_xpath('//a[contains(@href,"contact")]').click()

Sign up to request clarification or add additional context in comments.

1 Comment

oh... yeap) click()
0

you can use:

driver.find_element_by_link_text("Contact").click()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.