0

Iv been trying to get the form elements on this website and for some reason I cant get them. Iv tried every way I can think of. I would really appreciate some help.

Here is my latest attempt

inputs = driver.find_elements_by_xpath("//input[@type='text']")

Here is the website.

Thanks in advance.

Edit : Github link for project

Edit : Ok so I found out that if you go straigt to website that the btn points to then it works. So I am assuming that slenium does not automaticly update to the HTML of the current page. How does one do this?

7
  • What is the error what you get and and you show some more code? Commented Mar 1, 2019 at 8:29
  • The xpath seems fine. I am able to find elements in DevTools. What exactly is the problem? Commented Mar 1, 2019 at 8:30
  • Let me update the github and Ill put the link and basicly i get an error saying "No Such Element" Commented Mar 1, 2019 at 8:31
  • I think element Id id dynamic value.Try some other attribute which is static on the page.It should work. Commented Mar 1, 2019 at 8:40
  • @KajalKundu I think I have tried just about every useful attribute. Commented Mar 1, 2019 at 8:43

2 Answers 2

1

if you are getting 'NoSuchElementException', try using conditional wait before you do find_element. When you are loading another page wait until the element is visible and can be interacted. Guide for that is here

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

1 Comment

This worked for the last problem I posted about thanks.
0

check if the element is inside in iform, if so use

driver.switchTo().frame("framename")

EDIT

Focus on something unique in the tag. For your example use the class name used in the div. Do not use the ID tag identifier as it changes over time.

//*[contains(@class, 'ginput_container ginput_container_text')]/following::*[contains(text(),'Email')]/following::div[1]/descendant::input

2 Comments

saddly it is not in a frame, there is some javascript and the text box is in a gform if you know anything about that
still getting no such element. Im assuming to implement that I need to just copy/paste it in the ()

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.