1

I can't figure this one out.

I am working on this site and I have used selenium in Python to click on the first element under the class name "yellow showPopupUnder" (the main part of the screen where there are 20 yellow rows of information about houses).

After I get Selenium to click on that row it opens up and shows more information. I am interested in the part where there are 'checked' and 'unchecked' boxes. Those checked boxes are in a div like so:

<div class="v_checked">

And the unchecked boxes are in a div like so:

<div class="v_unchecked">

I have tried reaching them in a few ways:

driver.find_element_by_class_name('v_checked')
driver.find_element_by_css_selector(".v_checked")
driver.find_element_by_xpath("//div[@class='v_checked']")

I have also tried to use the absolute xpath. All of these don't work and I get a "NoSuchElementException: no such element: Unable to locate element"

Does anybody know how to retrieve the data from those boxes?

Thank you!

keke
  • 53
  • 1
  • 8
  • Content of each drop-down menu located inside iframe that generated dynamically. You need to switch to each iframe to handle drop-down menu (and then switch back to default content) Check [how to switch to dynamic iframe](https://stackoverflow.com/questions/7534622/selecting-an-iframe-using-python-selenium/48729644#48729644) – Andersson Sep 05 '18 at 14:48

1 Answers1

0

There is a iframe used that opens up and shows more Information where those Checkbox are shown. You have to navigate to that iframe. You can do something like this:

## switch to the iframe ##
driver.switch_to_frame(driver.find_element_by_id("ad_iframe_2_1_1731213"))
## then you can search your checkbox##
driver.find_element_by_class_name('v_checked')
## Switch back to the "default content" (that is, out of the iframes) ##
driver.switch_to_default_content()
Lifestohack
  • 377
  • 4
  • 19