使用Chrome/Python/Selenium点击按钮 - 将代码移植到Windows 10后出现

2024-05-15 12:09:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我有代码可以打开一个网页,点击一个按钮,然后用userid/密码登录。我最近把代码移到了Windows10笔记本电脑上,现在代码出现了下面的错误。代码如下:

  time.sleep(2)
  inputElement = driver.find_element_by_class_name('hpui-primary-button')
  inputElement.click() 

下面是我得到的错误:

selenium.common.exceptions.WebDriverException: Message: unknown error: Element https://cf.passport.hpe.com/hppcf/login.do?cc=US&lang=EN&applandingpage=https://h22204.www2.hpe.com/NEP/Logon/NewHome?hpappid=115940_NONSTOP_PRO_HPE';"> is not clickable at point (710, 300). Other element would receive the click: ...

我尝试添加更长的延迟,但页面加载正常。在Windows7上工作,而不是在Windows10上


Tags: 代码httpscom网页密码time错误element