Reputation: 287
The following thing is embedded into a webpage. It is not part of the actual site:
What I've been trying to do is select the 'previous meetings' tab, using Selenium in Python.
These are the elements for both buttons (upcoming meetings and previous):
<div role="tab" aria-disabled="false" aria-selected="true" class="ant-tabs-tab-active ant-tabs-tab" tabindex="0" aria-label="Upcoming Meetings">Upcoming Meetings</div>
::before
Upcoming Meetings
</div>
<div role="tab" aria-disabled="false" aria-selected="false" class=" ant-tabs-tab" aria-label="Previous Meetings">Previous Meetings</div>
::before
Previous Meetings
</div>
I've tried driver.find_element_by_xpath('//*[@class=" ant-tabs-tab"]').click()
but that didn't detect the element.
When I view the actual source code of the webpage, these Zoom elements didn't show up, so I think that's why Selenium doesn't recognise it either.
It doesn't have an ID or anything else, so I can't try them. Is there anything I can do? (e.g. Just click a location on the screen)
Or am I doing something wrong?
It seems to be an iframe, starting with
<iframe src="about:blank" name="tool_content" id="tool_content" class="tool_launch" allowfullscreen="allowfullscreen" webkitallowfullscreen="true" mozallowfullscreen="true" tabindex="0" title="Tool Content" style="height:100%;width:100%;" allow="geolocation *; microphone *; camera *; midi *; encrypted-media *; autoplay *" data-lti-launch="true"></iframe>
If that helps.
I tried using an extension for Firefox that gave you the exact xpath of an element:
driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div/div/div[1]/div[1]/div/div/div/div[1]/div[2]').click()
And this still didn't work - how come??
Upvotes: 0
Views: 100
Reputation: 665
Try using
driver.switch_to.frame(driver.find_element_by_class_name("tool_launch"))
Upvotes: 0
Reputation: 9969
Due to having an iframe just switch to it
driver.switch_to.frame("tool_content")
Upvotes: 2