Selenium-WebDriver提供WebDriver API,用于控制不同编程语言的浏览器(“语言绑定”)。使用此标记时,还要为正在使用的编程语言添加标记。
我一直在尝试从以下网站下载pdf文件: http://www.cub.org.br/cub-m2-estadual/CE/ 问题是,当我单击“Gerar Relatório em PDF”(“生成 PDF
如何在 Python 中运行自动化 Selenium 测试时禁用这样的 Chrome 弹出窗口?
我目前正在为我的公司的一个大型 Django 项目编写一个自动化测试套件。一切都很顺利,直到我更新了 Chrome (v.125.0.6422.142) 和 Chromedriver (v.125.0.6422.1...
我正在努力使用 Selenium 单击弹出窗口的左侧菜单。我想从主弹出窗口导航到左侧菜单,然后单击名为“
Selenium-Webdriver, driver.findElement(...).getLocation 不是一个函数,为什么?
我正在尝试在 Selenium 元素上调用 .getLocation(),如下代码所示。 const webdriver = require('selenium-webdriver'); const 驱动程序 = new webdriver.Builder() .forBrowser('火狐'...
如何在使用 Web 驱动程序运行自动化 Python 脚本时处理 recaptcha
我正在开发一个项目,涉及使用网络驱动程序搜索并获取学校的网站链接。我的脚本必须查找大约 10 万所学校,因此需要自动化。不过,我还是保留了
我在这里有我的网站: 自动化测试 和 我的网站在这里: 自动 与 <input type="password" class="gigya-input-password with-addon form-control" gigya-conditional:show-password-strength="screenset.width < 900?up" name="password" autocomplete="off" gigya-expression:data-display-name="screenset.translations['PASSWORD_73132891594356050_DISPLAY_NAME']" gigya-expression:data-gigya-placeholder="screenset.translations['PASSWORD_73132891594356050_PLACEHOLDER']" data-screenset-element-id="gigya-password-155327446633034050" data-screenset-element-id-publish="true" data-screenset-roles="instance" gigya-default-show-password-strength="null" gigya-default-data-display-name="null" gigya-default-data-gigya-placeholder="null" data-gigya-name="password" data-original-value="" id="gigya-password-155327446633034050" aria-required="true" show-password-strength="up" data-display-name="Gib dein Passwort ein." data-gigya-placeholder="Hier Passwort eingeben" placeholder="Hier Passwort eingeben" maxlength="100" data-attr-value="Login - Password" data-attr-element="formfield"> 当我执行以下操作时: WebElement password = driver.findElement(By.className("gigya-input-password")); password.sendKeys(PASSWORD); 或 WebElement myElement = driver.findElement(By.className("gigya-input-password")); String js = "arguments[0].setAttribute('value','"+PASSWORD+"')"; ((JavascriptExecutor) driver).executeScript(js, myElement); 我收到以下错误: org.openqa.selenium.ElementNotInteractableException: element not interactable 如何使用 selenium webdriver 在字段中正确输入文本? 我已经有一个 Thread.sleep(2000); 来使元素可见。 并且 WebElement password = new WebDriverWait(driver, java.time.Duration.ofSeconds(10)).until(ExpectedConditions.elementToBeClickable(By.className("gigya-input-password"))); 给出 TimeoutException。 By.className("gigya-input-password") 上述定位器策略不正确,它没有定位到目标元素。它返回 16 个具有该 ClassName 的元素,请参见下文。 请改用以下 XPath 定位器策略: By.xpath("//input[@placeholder='Hier Passwort eingeben']")
我试图让 Selenium 在 EC2 机器上工作,但遇到了一个问题,当 VS Code 通过 SSH 连接进行连接时,该问题消失了。如果我仅使用终端进行连接,问题仍然存在...
当我知道该元素存在时,为什么我的脚本会引发 NoSuchElement 异常?
我编写了一个脚本,在其中定义了一个“下一页”函数,该函数滚动到页面底部,识别“下一页”按钮,然后单击该按钮导航到下一页。请参阅以下...
我尝试使用以下代码在网站上选择“Psychatrie”选项: 从硒导入网络驱动程序 从 selenium.webdriver.chrome.options 导入选项 来自 selenium.webdriver。
我正在尝试从以下网站收集个人资料和联系人的链接: https://www.dlapiper.com/en-us/people#t=All&sort=relevancy&numberOfResults=100&f:CountriesID=[U...
在下面的页面摘录中,我需要能够单击“应用程序配置文件” 但无论我尝试什么,我都无法让它发挥作用。 我不断收到 OpenQA.Selenium.NoSuchElementException。 在下面的页面摘录中,我需要能够单击“应用程序配置文件” 但无论我尝试什么,我都无法让它发挥作用。 我不断收到 OpenQA.Selenium.NoSuchElementException。 <body> <div id="main-page"> <div class="page"> </div> <div id="page-header" class="page-header"> <div id="page-header-navbar" class="page-header-navbar"> <div class="page-header-contents"> <div class="page-header-navbar-left"> <div class="nav-menus"> <div class="nav-menu" data-item="dashboard"> <div class="nav-menu-header selected -js-header"> <i class="nav-menu-icon fa fa-tachometer"></i> <span class="nav-menu-header-label">Dashboard</span> </div> </div> <div class="nav-menu" data-item="policy"> <div class="nav-menu-header -js-header"> <i class="nav-menu-icon fa fa-sitemap"></i><span class="nav-menu-header-label">App Profiles</span> </div> </div> </div> </div> </div> </div> </div> </div> </body> 这些已经尝试过: IWebElement element = driver.FindElement(By.XPath("//div[@class='nav-menu-header-label' and text()='App Profiles']")); IWebElement appProfilesElement = driver.FindElement(By.XPath("//span[text()='应用程序配置文件']")); 先尝试等待: from selenium.webdriver.support.ui import WebDriverWait # wait for 10 seconds wait = WebDriverWait(driver, 10) xpath = "//div[@class='nav-menu-header-label' and text()='App Profiles']" element = wait.until(EC.element_to_be_clickable((By.XPATH, xpath))) element.click()
Selenium Java:单击 Shadow-root 内带有 CSSselector 的按钮
我从这里弹出cookie: 网站 我用 Shadow-root 选择了它,如下所示: 如何 现在我想单击带有 xpath 表达式的按钮,如下所示: WebElement ShadowHost = driver.findElement(...
AttributeError:“MainPage”对象没有属性“find_element”
我在 selenium Python 上进行了这个测试: 导入pytest 从硒导入网络驱动程序 从 selenium.webdriver.support.ui 导入 WebDriverWait 从 selenium.webdriver.support 导入预期条件 ...
使用 selenium 关闭 javascript 弹出窗口
我正在使用 selenium 编写一个小型 python 示例,以从我居住的地区获取 hemnet 网站的信息。当我使用 selenium 打开页面时,会出现一个弹出窗口,但我没有找到...
我正在尝试从“https://tariffs.ib-net.org/sites/IBNET/TariffTable#”中抓取分页表,其中所有页面的 url 保持相同。 我已经参考以下页面寻求帮助,...
我正在尝试通过以下链接下载pdf: https://www.cms.gov/medicare-coverage-database/view/lcd.aspx?lcdid=39763&ver=8 该网站上的大多数文档都会弹出接受
Selenium-Jupiter - 仅使用本地浏览器/驱动程序
我想使用 selenium-jupiter JUnit5 扩展进行 CI/CD 运行: 硒-木星 不幸的是,使用的 WebDriverManager 正在从互联网动态获取浏览器/驱动程序。 为了让...
我正在尝试使用 xpath 选择并单击三个单选按钮之一,但运气不佳。有代码建议吗?
HTML: HTML: <input class="PrivateSwitchBase-input css-1m9pwf3" type="radio" data-testid="person-select-radio-1" aria-label="1 person" value="" checked="" name="mui-48"> <input class="PrivateSwitchBase-input css-1m9pwf3" type="radio" data-testid="person-select-radio-2" aria-label="2 person" value="" checked="" name="mui-48"> <input class="PrivateSwitchBase-input css-1m9pwf3" type="radio" data-testid="person-select-radio-3" aria-label="3 person" value="" checked="" name="mui-48"> <input class="PrivateSwitchBase-input css-1m9pwf3" type="radio" data-testid="person-select-radio-4" aria-label="4 person" value="" checked="" name="mui-48"> 代码: WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,"//*input[@id='person-select-radio-4']"))) WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,"//*[contains(text(),'person-select-radio-4')]"))) 既不工作也不超时 第一个 XPATH 不起作用,因为它们没有 id。 第二个 XPATH 不起作用,因为 'person-select-radio-4' 不在 <input...>text</input> 中的文本中 你必须使用data-testid '//input[@data-testid="person-select-radio-4"]' 或aria-label '//input[@aria-label="4 person"]'
我在将 Selenium 作为外部库导入/添加到我的 (Intelij) JavaFX 项目时遇到问题
我正在尝试在使用 JAVA 开发的 Web 自动化软件中使用 selenium,以下是我尝试使用 Intelij 作为代码编辑器执行的代码片段: 公开课妈...
options.platform_name = 'Windows' 不工作 selenium python
chromedriver 版本:125.0.6422.141 (r1287751)(64 位) chrome 版本:125.0.6422.142(官方版本)(64 位) 硒版本:4.21.0 从硒导入网络驱动程序 来自 selenium.webdriver.c...