在 Python Jupyter Notebook 中使用 Selenium 单击下拉列表

特雷弗·怀特曼

如何单击带有以下 HTML 的按钮?单击按钮时,它会提供一个下拉列表和多个选项(但在下方您可以看到它仅显示“所有注册表”)。

我尝试了许多版本,但没有运气:driver.find_element_by_id() 和 driver.find_element_by_class_name()

在此处输入图片说明

游轮潘迪

您可以all registries使用以下代码单击

路径:

//strong[text()='all registries']/../../..

在这样的代码中使用它:

wait = WebDriverWait(driver, 10)
wait.until(EC.element_to_be_clickable((By.XPATH, "//strong[text()='all registries']/../../.."))).click()

进口:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在Jupyter Notebook单元中使用单击库

如何使用Selenium Webdriver Python单击呼叫下拉列表?

在Python中使用Selenium单击下拉列表时出现问题

如何在 python 中使用 Selenium 包单击多个复选框和下拉列表?

如何在 Python 中使用 Selenium 单击下拉列表的 li 元素^

在 Jupyter notebook 中使用 main 方法调用 Python 文件

在 jupyter notebook 中使用 python 循环播放声音

在Jupyter Notebook中使用Python虚拟环境

在Jupyter Notebook中使用Ctypes

在Jupyter Notebook中使用Tkinter

无法使用Jupyter Notebook运行python代码

使用Jupyter Notebook(Python)导入wordcloud

使用Python Jupyter Notebook弹出图

在 Python 中使用 Selenium 抓取动态下拉列表

如何在 python 中使用 selenium 选择下拉列表的项目

单击 AngularJS 中的下拉列表以获取除使用 Python 和 Selenium 选择以外的元素

在Ipython中使用Pylint(Jupyter-Notebook)

无法在Jupyter Notebook中使用Pyodbc模块

在Jupyter Notebook中使用conda环境

在 jupyter notebook 中使用未上传的文件

使用Python下拉列表和Selenium

PYTHON Selenium:单击包含Java的特定下拉列表

如何在Pandas和Jupyter Notebook中使用可单击的超链接创建表

如何在 jupyter notebook 中使用 TensorFlow?我已经通过 python 3.5 pip 安装了 TensorFlow

如何在Jupyter Notebook中使用来自外部Python文件的代码?

如何在 Anaconda 中的 Jupyter notebook 中使用 Python 连接 Cassandra?

如何在 vscode jupyter notebook 中使用创建的 python 虚拟环境

在 Jupyter Notebook 中将 Python 列表的每个元素作为代码运行

在 Jupyter Notebook 中使用 ipywidgets 和 asyncio 以交互方式创建列表