第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法單擊彈出窗口中的子按鈕

無法單擊彈出窗口中的子按鈕

當年話下 2023-12-20 16:04:08
我對硒有疑問:我無法單擊由我單擊的第一個按鈕生成的彈出窗口中包含的按鈕。    from selenium import webdriver    from selenium.webdriver.common.by import By    from selenium.webdriver.support.ui import WebDriverWait    from selenium.webdriver.support import expected_conditions as EC    from selenium.webdriver.firefox.options import Options    # Webdriver    browser = webdriver.Chrome('C:\\Users\\zlell\\PycharmProjects\\PyroLello\\Userbot\\chromedriver.exe')    browser.get("https://www.eventbrite.com/e/120621788015")    # This button originates a pop-up    python_button = browser.find_element_by_xpath('//*[@id="eventbrite-widget-modal-trigger-120621788015"]')    # Click    python_button.click()    # The pop-up with the new button appears    # Try to find the button included in the pop-up - Doesn't work    python_button_2 = browser.find_element_by_css_selector("button.eds-btn.eds-btn--button.eds-btn--fill")    # Click - Doesn't Work    python_button_2.click()
查看完整描述

1 回答

?
慕田峪7331174

TA貢獻1828條經(jīng)驗 獲得超13個贊

添加頁面加載后的等待。抓住 iframe 并切換到它。


iframe = WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.TAG_NAME, "iframe")))

browser.switch_to.frame(iframe)

python_button_2 =WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, "button.eds-btn.eds-btn--button.eds-btn--fill")))

進口


from selenium.webdriver.common.by import By

from selenium.webdriver.support.ui import WebDriverWait 

from selenium.webdriver.support import expected_conditions as EC


查看完整回答
反對 回復(fù) 2023-12-20
  • 1 回答
  • 0 關(guān)注
  • 179 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號