草庐IT

Watir-webdriver

全部标签

c# - 如何在静默模式下执行 Selenium Chrome WebDriver?

当使用ChromeSeleniumWebDriver时,它会在服务器启动时输出诊断输出:StartedChromeDriver(v2.0)onport9515我不想看到这些消息,我该如何抑制它们?我这样做ChromeOptionsoptions=newChromeOptions();options.AddArgument("--silent");IWebDriverDriver=newChromeDriver(options);但诊断输出并没有被抑制。 最佳答案 我只是这样做ChromeOptionsoptions=newChrom

selenium定位元素报错——AttributeError: ‘WebDriver’ object has no attribute ‘find_elements_by_class_name’

报错:查看find_elements的源码(发现是源码改了):之前的写法: 现在:记住加一句:fromselenium.webdriver.common.byimportBy运行成功!

pyinstaller打包selenium报错找不到webdriver

遇到的情况:使用pyinstaller-w-F打包selenium在大部分机器上运行正常但是少数机器上运行报错selenium版本:3.141.0报错内容:Message:‘chromedriver.exe’executableneedstobeinPATH.Pleaseseehttps://sites.google.com/a/chromium.org/chromedriver/home关键代码:chrome_location='./Chrome/chrome.exe'chrome_path="./Chrome/chromedriver.exe"browser=webdriver.Chrom

python+selenium使用webdriver启动chrome出现闪退现象解决

这两天发现之前开发的爬虫程序出问题了:谷歌浏览器出现打开立即闪退的现象,代码未修改过,检查也没有任何问题!查看chrome浏览器发现版本更新了↑(点击chrome浏览器右上角三个点,最下面帮助→GoogleChrome查看版本)webdriver需要和浏览器版本相对应!!!!需要更新webdriver的版本!!http://chromedriver.storage.googleapis.com/index.htmlhttps://registry.npmmirror.com/binary.html?path=chromedriver/↑链接为webdriver版本下载地址下载与本机相对应的版本

python+selenium使用webdriver启动chrome出现闪退现象解决

这两天发现之前开发的爬虫程序出问题了:谷歌浏览器出现打开立即闪退的现象,代码未修改过,检查也没有任何问题!查看chrome浏览器发现版本更新了↑(点击chrome浏览器右上角三个点,最下面帮助→GoogleChrome查看版本)webdriver需要和浏览器版本相对应!!!!需要更新webdriver的版本!!http://chromedriver.storage.googleapis.com/index.htmlhttps://registry.npmmirror.com/binary.html?path=chromedriver/↑链接为webdriver版本下载地址下载与本机相对应的版本

解决Selenium WebDriver 加载页面时出现浏览器闪退

webdrive驱动edge浏览器打开网页后,会出现自动退出了情况时,大概率都是浏览器驱动和浏览器版本不一致的问题!以edge为例,我们可以通过点击浏览器的设置,找到关于MicrosoftEdge查看当前的浏览器版本是否匹配webdriver的版本。 如果不匹配的话,可以去以下网址下载https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 如果还是不能解决selenium闪退,可以通过以下几行代码来解决此问题。fromseleniumimportwebdriverfromselenium.webdriver.e

c# - Selenium WebDriver - 如何使用 C# 设置页面加载超时

我正在使用Selenium2.20WebDriver通过C#创建和管理firefox浏览器。要访问页面,我使用以下代码,在访问URL之前设置驱动程序超时:driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));//Setimplicitwaittimeoutsto5secsdriver.Manage().Timeouts().SetScriptTimeout(newTimeSpan(0,0,0,5));//Setscripttimeoutsto5secsdriver.Navigate().GoToUrl(my

c# - Selenium WebDriver - 如何使用 C# 设置页面加载超时

我正在使用Selenium2.20WebDriver通过C#创建和管理firefox浏览器。要访问页面,我使用以下代码,在访问URL之前设置驱动程序超时:driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));//Setimplicitwaittimeoutsto5secsdriver.Manage().Timeouts().SetScriptTimeout(newTimeSpan(0,0,0,5));//Setscripttimeoutsto5secsdriver.Navigate().GoToUrl(my

Python selenium中出现错误:driver = webdriver.chrome() TypeError: ‘module‘ object is not callable

目录代码如下报错详情解决办法方法一:方法二:方法三:代码如下fromseleniumimportwebdriverimporttimedriver=webdriver.chrome()driver.get("https://www.baidu.com")time.sleep(3)driver.find_element_by_id("kw").send_keys("花千骨")driver.find_element_by_id("su").click()driver.quit()报错详情解决办法方法一:chrome的首字母应该为大写,如下:driver=webdriver.Chrome()修改代码

c# - Selenium 错误 - 对远程 WebDriver 的 HTTP 请求在 60 秒后超时

我已经使用Selenium好几个月了,我们用它来自动化我们的一些内部测试流程。脚本一直通过良好。我最近使用FF27.01升级到C#2.40.0webdriver,我们的脚本现在在随机位置失败并出现以下错误。[Portal.SmokeTest.SmokeRunTest.Booking]TearDownmethodfailed.OpenQA.Selenium.WebDriverException:TheHTTPrequesttotheremoteWebDriverserverforURLhtt(p)://localhost:7055/hub/session/56e99e88-ba17-4d