-
Notifications
You must be signed in to change notification settings - Fork 0
/
iframe.py
31 lines (20 loc) · 865 Bytes
/
iframe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC, wait
import time
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_submit_get")
driver.implicitly_wait(4)
driver.switch_to.frame('iframeResult')
# driver.find_element(By.XPATH,"/html/body/button").click()
driver.execute_script("myFunction()")
driver.switch_to.default_content()
frames = driver.find_elements(By.TAG_NAME,"iframe")
for frame in frames:
print(frame.get_attribute("id"))
print(len(frames))