草庐IT

chromium-chromedriver

全部标签

python - 如何在 Python 中使用 Selenium-chromeDriver 在 Chrome 中打开新标签页

有人用过ChromeDriver在Chrome中打开新标签页吗?使用这段代码,我可以在Chrome中打开我的index.html:driver=webdriver.Chrome("/usr/bin/chromedriver")driver.get("localhost:3000")然后我想在新标签页中打开localhost:3000/cloudPeer.html:driver.find_element_by_tag_name("body").send_keys(Keys.CONTROL+'t')driver.get("localhost:3000/cloudPeer.html")这在F

Python + Mac 浏览器 : Error - 'chromedriver' executable needs to be in PATH

我做了以下但遇到了错误:selenium.common.exceptions.WebDriverException:Message:'chromedriver'executableneedstobeinPATH.Pleaseseehttps://sites.google.com/a/chromium.org/chromedriver/homefromsplinterimportBrowserbrowser=Browser('chrome')如何使用Mac解决问题?预先感谢您,一定会点赞/接受答案! 最佳答案 在Mac上解决此问题的最

python - 没有这样的元素 : Unable to locate element using chromedriver and Selenium in production environment

我有一个seleniumchromedriver问题,我无法弄清楚是什么原因造成的。几周前一切正常,突然这个错误开始出现。问题来自以下功能。deflogin_(browser):try:browser.get("some_url")#usercredentialsuser=browser.find_element_by_xpath('//*[@id="username"]')user.send_keys(config('user'))password=browser.find_element_by_xpath('//*[@id="password"]')password.send_ke

python - Selenium Chromedriver 挂起?

我有一个长时间运行的python应用程序,它会定期(每30-60秒)打开一个带有selenium和chrome驱动程序的网页,运行一些javascript并截取屏幕截图。它在Xvfb中带有chrome的EC2ubuntu实例上运行,并且在大多数情况下一切正常,除了程序会间歇性地挂起。它发生在这些线路之一:options=Options()options.add_argument("--disable-web-security")options.add_argument("--webdriver-logfile=webdrive.log")dc=DesiredCapabilities.C

python - 在 Heroku 上使用 Python selenium 运行 ChromeDriver

所以我在Heroku上有一个Flask服务器,它已经按预期正常工作了一段时间。现在,根据新的要求,我需要向Flask服务器添加功能以从外部网站获取页面。由于某些原因我最了解的是,我正在使用Selenium和Chrome网络驱动程序来执行此操作。我可以在本地进行设置并且工作正常,但我不确定如何在Heroku服务器上进行设置。我阅读了一些关于buildpacks的内容,并找到了这个ChromeDriver的buildpack:https://elements.heroku.com/buildpacks/jimmynguyc/heroku-buildpack-chromedriver但是,我

python - Selenium Chromedriver 不导航到 url

我现在拥有的是:chrome_options=Options()chrome_options.add_extension(r"C:\Users\x\OneDrive\Desktop\pp\crxSolver.crx")driver=webdriver.Chrome(r'C:\Users\x\OneDrive\Desktop\chromedriver.exe',options=chrome_options)driver.get("https://www.google.com")我可以打开webdriver,并且我在googleChrome的右上角看到了我添加的扩展,但是驱动程序没有转到g

python - 如何使用 Selenium ChromeDriver 执行右键单击?

我一直在搜索这个,但找不到Python的答案。是否可以通过selenium/chromedriver模拟右键单击或打开上下文菜单?我见过Java和其他一些语言的选项,但从未见过Python。我需要做什么来模拟右键单击链接或图片? 最佳答案 它在selenium.webdriver.common.action_chains中称为context_click.请注意,Selenium无法对浏览器级别的上下文菜单执行任何操作,因此我假设您的链接将弹出HTML上下文菜单。fromseleniumimportwebdriverfromselen

python - 'Webdrivers' 可执行文件可能有错误的权限。请参阅 https ://sites. google.com/a/chromium.org/chromedriver/home

我环顾四周检查了这两个文档,但没有找到答案。我一直在尝试将InstaPy用于python的instagramapi。在因多个错误而失败并假设InstaPy只是遇到一些问题后,我尝试使用selinium对其进行原始编码。在插入示例代码并根据自己的喜好对其进行更改后,我只是确保该代码可以正常工作。我收到了一个新错误而不是旧错误,说权限可能不正确。我试过重新安装并以管理员身份运行,但没有任何效果。我该如何解决这个问题和/或这是什么意思代码:importtimefromseleniumimportwebdriverdriver=webdriver.Chrome('C:\Webdrivers')

python - WebDriverException : Message: Service chromedriver unexpectedly exited. 状态代码为:127

我想在我的服务器上使用selenium构建我的爬虫。因此我已经在我的Ubuntu17.10服务器上安装/下载了所需的依赖项——例如chromedriver、chromium-browser等但是,当我运行以下代码时:driver=webdriver.Chrome()它返回以下错误:---------------------------------------------------------------------------WebDriverExceptionTraceback(mostrecentcalllast)in()---->1driver=webdriver.Chrome

python - 如何在 pyinstaller 中包含 chromedriver?

我正在使用pyinstaller创建我的python脚本的可执行文件。在我使用这些导入的脚本中:fromseleniumimportwebdriverfromselenium.webdriver.chrome.optionsimportOptionsetc...问题是,当运行pyinstallermyscript.py时,它会导致包含Firefox,而不是Chrome。在结果文件夹c:...\dist\myscript\selenium\webdriver中有一个firefox文件夹,所以它只是跳过chromedriver,这对我来说是一个严重的问题,因为脚本需要与Chrome一起运行