selenium-webdriver 相关问题

Selenium-WebDriver提供WebDriver API,用于控制不同编程语言的浏览器(“语言绑定”)。使用此标记时,还要为正在使用的编程语言添加标记。

使用 pip 安装 Selenium 时出错:获取构建 Wheel 的要求未成功运行

我正在尝试使用 pip 安装适用于 python 的 Selenium 包,但在“获取构建轮子的要求”时不断收到此错误。 PS C:\用户\Oisin epositories\Scraper> python .\scrapeData.py

回答 1 投票 0

无法在for循环之外打印窗口ID

我正在尝试打印我的父窗口 id ,但我得到的输出为空。 无法理解我在哪里犯了错误。 [在此处输入图像描述](https://i.sstatic.net/kEP3fDZb.png) 出去...

回答 1 投票 0

有没有办法点击iFunny网站首页的“登录”提示?

我一直在尝试找到一种使用 Selenium 自动单击并登录 iFunny 的方法(我为此使用 Python),但我找不到一种方法来检测/找到正确“单击&qu”的元素...

回答 1 投票 0

终止由 Chromium 和 Selenium WebDriver 创建的不必要的 chrome 进程

我正在尝试运行一个需要相当长时间才能完成的 Selenium WebDriver 脚本。问题是,在我的服务器上执行上述脚本时,大约一个半小时后,操作

回答 2 投票 0

Selenium 上无法根据 select 的文本选项定位元素的解决方案

我正在努力使用 PHP Selenium 创建自动单击,以便基于文本名称而不是值选项创建自动单击,因为该值是随机的。 超文本标记语言 我正在努力使用 PHP Selenium 创建自动点击,用于基于文本名称的 select2 下拉列表,而不是值选项,因为该值是随机的。 HTML <div class="input-group-prepend"> <select name="target" id="target" class="form-control select2-hidden-accessible" data-select2-id="select2-data-acctarget" tabindex="-1" aria-hidden="true"> <option value="" data-select2-id="select2-data-4-lu1l">-- Please Select --</option> <option value="hashrandom" data-select2-id="select2-data-5-i9za">Option1</option> </select> <span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="select2-data-3-0a3d" style="width: 360.312px;"> <span class="selection"> <span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-disabled="false" aria-labelledby="select2-acctarget-container"> <span class="select2-selection__rendered" id="select2-acctarget-container" role="textbox" aria-readonly="true" title="-- Please Select --">-- Please Select --</span> <span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span> </span> </span> <span class="dropdown-wrapper" aria-hidden="true"></span> </span> <button type="button" class="btn btn-link btn-sm" data-toggle="tooltip" data-placement="top" title="" data-original-title="tooltips_target"><i class="fa fa-question-circle"></i></button> </div> 代码 if(!$this->wait('#target','visibilityOfElementLocated',5,500)) return $this->sendError('form not found'); if($this->executeScript("$('#target').click();")); if(!$this->click('option[text=\'Option1\']')) return $this->sendError('select error.'); 但出现错误 NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"option[text='Option1']"} 根据 文档,有一个 WebDriverSelect 类可以与 SELECT HTML 元素一起使用。 代码看起来像这样 $selectElement = $driver->findElement(WebDriverBy::id('target')); $select = new WebDriverSelect($selectElement); $select->selectByVisibleText('Option1'); 或 $selectElement = $driver->findElement(WebDriverBy::id('target')); $select = new WebDriverSelect($selectElement); $select->selectByValue('hashrandom');

回答 1 投票 0

Firefox 浏览器阻止执行异步 JavaScript?

我在 Selenium 框架中为我的 Web 应用程序编写了简单的测试,它在 Chrome 和 Edge 上运行得很好。 但只有在 Firefox 中,异步脚本才会超时,这可能是一个问题...

回答 1 投票 0

Selenium Chromedriver 失败并出现堆栈跟踪错误消息

我正在使用 Selenium (Python) 从雅虎财经抓取数据。当使用 WebDriverWait 从此页面查找给定日期的收盘价时,我收到如下异常: 信息: 堆栈跟踪: ...

回答 1 投票 0

无法标记正确的元素以在 Python 中使用 Selenium 抓取网站

我正在尝试抓取这个网站,一旦插入详细信息,该网站就会显示公用事业账单信息。该网站要求我插入一些信息并单击一些选项。 我...

回答 1 投票 0

如何使用 Selenium 抓取动态渲染的网页?

这是我正在尝试抓取的页面。我的目标是检查字符串“任何可用的池将出现在此处”。位于页面上。 我做了一些研究并发现......

回答 1 投票 0

Selenium select点击拦截。 Select.select_by_value()

我想通过选择选择对象中的值来更改表中的行数。选择被 google iframe 遮挡。我可以点击 iframe 的“x”按钮,但 google iframe 仍然存在。

回答 1 投票 0

在python中部署selenium/flask/docker脚本

我在渲染中部署硒抓取脚本时遇到一些问题。在本地,脚本运行良好,当我在渲染上部署它并尝试访问端点以触发脚本时,这是...

回答 1 投票 0

我正在尝试使用 selenium python 来抢占一个网站,但它没有向我打印所有结果[重复]

我正在使用selenium 扫描booking.com,它有超过600 个结果,但selenium 只扫描了51 个结果。我不知道我做错了什么。这是我的代码。 从硒导入网络驱动程序 从se...

回答 1 投票 0

Selenium 不可靠地返回查找到的元素

我被困住了..这么多个小时..在这里查找了数百个问题和答案.. 我想从银行产品网站 grep 数据,例如“德尔塔”来自: https://wertpapiere.ing.de/Investie...

回答 1 投票 0

我正在尝试使用 selenium python 来抓取一个网站,但它没有给我所有结果

我正在使用selenium 扫描booking.com,它有超过600 个结果,但selenium 只扫描了51 个结果。我不知道我做错了什么。这是我的代码。 从硒导入网络驱动程序 从se...

回答 1 投票 0

如何查找并点击网站的按钮?

我尝试开发一个基于Selenium的python脚本来操作网站。这是网站: https://www.heatpumpkeymark.com/en/?type=109126&tx_pskeymark_frontend%5Bholder%5D=2482&

回答 1 投票 0

如何获取<br>标签后的文本

网站 兰博基尼 网站 <p style="margin:1em auto; padding:0 1em; max-width:700px;"> <b> Lamborghini</b> <br> <img style="width:300px" src="https://i0.wp.com/www.car-revs-daily.com/wp-content/uploads/2016/02/2011-Lamborghini-EGOISTA-22.jpg"> <br> 2013 Lamborghini Egoista </p> 我想提取随机汽车的名称(2013 Lamborghini Egoista)。 我已经尝试过: String text= (String) jsExecutor.executeScript("document.querySelector('#output-container p').innerText;"); System.out.println(text); ,但没有成功: org.openqa.selenium.JavascriptException:javascript错误:无法读取 null 的属性(读取“innerText”) 这里是使用 JavaScript 代码的示例,您可以尝试在 Selenium 中模拟步骤: // get the container element first const containerELe = document.querySelector("#output-container"); // get the br (second br in the container) const brElement = containELe.querySelector('br:nth-of-type(2)'); // get the node after the br const nameNode = brElement.nextSibling; // get text content const name = nameNode.textContent.trim();

回答 1 投票 0

等待元素出现在Selenium中(WebDriverWait)

当我们收到 Selenium 中的元素列表时,使用“find_elements”命令,我们从该列表中选择一个元素,例如列表中的元素号 2 示例:driver.find_elemen...

回答 2 投票 0

使用 python 和 selenium 从网站检索课程表更改 No Such Element 错误、ID、XPATH 等

我的学校有一个系统可以告诉我们日程安排是否有任何变化。 从硒导入网络驱动程序 从 selenium.webdriver.common.by 导入 从 selenium.webdriver.support.ui 导入 WebDriverW...

回答 1 投票 0

如何使用 Python Selenium 读取 Excel 文件并将其插入到我的 Web 表单中?

我创建了一个脚本来从 CSV 文件中读取数据并将其输入到我的 Web 表单中,但是我无法以正确的形式将一些数据保存在 CSV 文件中,我需要转换该脚本,以便它.. .

回答 1 投票 0

Pylance 无法识别 selenium 的 TimeoutException 类

我正在使用 VisualCode,当我尝试从 Selenium 库导入 ConnectionRefusedError 时,出现错误。下面是我的代码片段 从 selenium.common.exceptions 导入

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.