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

gehbiszumeis
  • 3,525
  • 4
  • 24
  • 41
DaveM
  • 1
  • 1
    Please show relevant parts of your code within the question and not as screenshot. See [here](https://stackoverflow.com/help/how-to-ask) for more info about that – gehbiszumeis Oct 12 '18 at 06:19

2 Answers2

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

somebody4
  • 505
  • 4
  • 14
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)
Infern0
  • 2,565
  • 1
  • 8
  • 21