0

I am right at the end of my script and this must be the last page I have to go through and I am stuck. I have spend 3hrs with different combination and different methods trying to load the elements.

the page is heavly javascript so when I try and get page source it gives me

This page uses frames, but your browser doesn't support them.

I have identified there are two frames inside the window and tried to apply all the attempts against both frames.

The result when I try and select to the frame

**driver.find_element_by_xpath('''//*[@id="three"]/tbody/tr[2]/td/div[2]/a/input''').click()**

error

**Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="three"]/tbody/tr[2]/td/div[2]/a/input"}**

i have also tried the below with or without the [0] on all frames still the same issue

**driver.find_element_by_xpath('.//input[@type="radio" and @value="05"]')[0].click**

I have tried this but also get the same error

**element = driver.find_element_by_id("reason")**

Below is a screenshot of the code in the inspector window. screenshot of inspector

1
  • 1
    Please show relevant parts of your code within the question and not as screenshot. See here for more info about that Commented Oct 12, 2018 at 6:19

2 Answers 2

1

try to switch to the containing frame first:

parent_frame=driver.find_element_by_css_selector('your selector')
driver.switch_to.frame(parent_frame)

#select the button after

How to identify and switch to the frame in selenium webdriver when frame does not have id

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

Comments

0

Try with driver click on radio button

element = driver.find_element_by_xpath("//table[@id="three"]//input[@name="reason"]")
element.click();

or javascript executor

element = driver.find_element_by_xpath("//table[@id="three"]//input[@name="reason"]")
driver.execute_script("arguments[0].click();", element)

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.