【问题标题】:Element's Click Intercepted [duplicate]元素的点击被拦截[重复]
【发布时间】:2022-01-05 12:20:42
【问题描述】:

我一直试图让 selenium 为我点击一个按钮,但我得到的只是元素点击被拦截

我首先想到了异常处理,但我想知道是否有更好的方法

反正我有点迷茫

from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from win10toast import ToastNotifier as Notifier
from selenium.webdriver.common.by import By
from selenium import webdriver
from time import sleep

Path: str = "C:\\Users\\rolan\\Desktop\\chromedriver.exe"
Link: str = "https://www.roblox.com"

Notification = Notifier()
Notification.show_toast("hulks bot", "settings things up...")

sleep(1)

Option = Options()
Option.add_argument("start-maximized")

Browser = webdriver.Chrome(service = Service(Path), options = Option)
Browser.get(Link)

def Perform_Actions():
    sleep(1)

    Login_Button = Browser.find_element(By.ID, "main-login-button")
    Login_Button.click()

Perform_Actions()```

much appreciated help

【问题讨论】:

    标签: python selenium webdriver


    【解决方案1】:

    修复了您需要做的只是单击所有内容的主容器(只是屏幕)

    【讨论】:

      猜你喜欢
      • 2019-11-08
      • 2021-09-04
      • 2020-02-06
      • 2021-10-28
      • 2021-05-03
      • 1970-01-01
      • 2021-02-26
      • 2020-02-23
      • 2020-01-04
      相关资源
      最近更新 更多