1

I am trying to get the 'innerhtml' nested within the element:

<select name="cmbCameras" id="cmbCameras" onchange="GetCameraByID($(this).val());" class="Textbox" style="width:254px;">

My code as of now is:

driver = webdriver.Firefox()
driver.get("http://www.gatewayguide.com/")
time.sleep(10)
driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
html = driver.find_element_by_id("cmbCameras")
elem = html.get_attribute('innerHTML')

However selenium can never locate the element I want. What am I doing wrong?

0

1 Answer 1

3

The problem is that there are multiple iframe tags on the page. You need the second one:

driver.switch_to.frame(driver.find_elements_by_tag_name("iframe")[1])
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.