我对硒有疑问:
我无法单击由我单击的第一个按钮生成的弹出窗口中包含的按钮。
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()
慕田峪7331174
相关分类