草庐IT

selenium4

全部标签

python - 用python定义chromedriver selenium的下载目录

一切都在标题中!有没有办法定义用于python的selenium-chromedriver的下载目录?尽管进行了许多研究,但我还没有找到确凿的结论......作为新手,我已经看到很多关于Chromedriver的“thedesired_capabilities”或“theoptions”的东西,但没有任何东西可以解决我的问题......(我仍然不知道它是否会!)进一步解释我的问题:我有很多url要扫描(200000),每个url都有一个文件要下载。我必须创建一个表格,其中包含url、我在上面删除的信息以及我刚刚为每个网页下载的文件的名称。对于我必须处理的量,我创建了线程来打开chrom

python - 修改 selenium python 绑定(bind)中的语言选项时遇到问题

我结合selenium在python中创建了一个脚本,以从googleplay商店抓取不同的应用程序名称,当我执行我的脚本时,它们都会出现。然而,结果被转换成我的母语,而不是英语。如何修改seleniumpython绑定(bind)中的语言选项?我的尝试(尝试更改语言选项但失败):fromseleniumimportwebdriverfromselenium.webdriver.common.byimportByfromselenium.webdriver.chrome.optionsimportOptionsfromselenium.webdriver.support.uiimpor

python - 如何在 ubuntu 上为 python3 selenium 安装 firefoxdriver webdriver?

我在Ubuntu16.04上安装了python3-seleniumapt包。安装时,收到一条消息:Suggestedpackages:chromedriverfirefoxdriverThefollowingNEWpackageswillbeinstalled:python3-selenium当我尝试在python3-django中运行测试用例时,出现以下错误:FileNotFoundError:[Errno2]Nosuchfileordirectory:'/usr/lib/firefoxdriver/webdriver.xpi'我确实在Ubuntu存储库中搜索了名为firefoxdr

Python Selenium 发送键给出大小警告

我正在通过pythonselenium绑定(bind)上传内容element.send_keys(content),但我收到内容大小错误。我的数据会变大。能否请您给我一个解决方案,通过该解决方案我可以将所选元素附加到block中,而不是将完整和完整的数据放入我要输入数据的所选字段中?我的意思是我想将数据分block放入所选元素,而不是通过单个操作将其放入。出现这种错误,似乎对我的系统和python也不利。但我不确定。只是想知道这是真的吗?请告诉我如何通过send_keys分block发送数据。得到它的解决方案是非常必要和迫切的。感谢您的帮助。[1560:9968:1211/012355

Python Selenium ConnectionResetError : [WinError 10054] An existing connection was forcibly closed by the remote host

我正在使用python3.6并使用最新版本的chromedriver,我尝试使用旧版本的chromedriver,我遇到了同样的问题,重新启动了我的电脑,同样的问题。这是我运行以重现错误的代码:fromseleniumimportwebdriverdriver=webdriver.Chrome()driver.get("https://google.com")完整错误:driver.get("https://google.com")File"C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py",lin

python - 在 Selenium 中显示当前光标位置

有没有办法显示当前光标位置或类似的东西?我有一个应该点击某个对象上的确切点的Action链,但我想我选错了坐标。我使用Firefoxwebdriver。脚本如下所示:fromseleniumimportwebdriverimporttimefromselenium.webdriver.common.action_chainsimportActionChainsdriver=webdriver.Firefox()driver.get("http://www.mysite/")elem=driver.find_element_by_xpath('//div[@id="player"][1]

python - 使用 Selenium Webdriver 和 Python 检测音频

也许不容易做到,但我希望能够在Selenium中加载网页并测试flash或html5是否自动播放音频。理论上,当用户访问我的网站时,他们可以看到视频播放但看不到音频(正确方式)有时音频会随着视频自动播放,这是我不想要的。我想知道是否有办法检测是否有任何音频正在通过python和firefox播放?我的内部测试将加载页面并进行大量selenium检查以确保一切正常。我想做的是添加一个测试,如果音频正在播放并标记它,它还会使用python或selenium检查。有什么想法吗? 最佳答案 我也有类似的问题。我通过网络处理大量音频。我必须自

使用 TOR 获取代理的 Python selenium 适用于 firefox,但不适用于 chrome

在过去的几天里,我一直在玩弄python,从youtube学习,并决定创建一些我喜欢自动化的东西。我发现了一个小问题-当我在Firefox浏览器上使用我的python脚本时,我可以在后台打开Tor浏览器并使用此代码:profile=webdriver.FirefoxProfile()profile.set_preference("network.proxy.type",1)profile.set_preference("network.proxy.socks",'127.0.0.1')profile.set_preference("network.proxy.socks_port",9

python - Selenium:在谷歌浏览器中上传文件

由于SeleniumRC“attach_file”仅支持*Firefox,是否有任何方法可以在GoogleChrome中上传文件?非常感谢任何建议或解决方法。 最佳答案 如果您使用的是Webdriver,那么要上传文件,您只需使用“sendKeys”输入文件路径即可。您需要“跳过”单击打开对话框以选择文件的浏览按钮的部分。适合我的Java版本如下所示,WebElementinputFilePath=driver.findElement(By.id("filepath"));inputFilePath.sendKeys("/absol

python - 权限被拒绝 : 'geckodriver.log' while running selenium webdriver in python

我已经在centos上安装了Firefox和Selenium。我正在使用Xvfb和pyvirtualdisplay打开浏览器。当我尝试运行seleniumwebdriver时,我能够打开一个新的显示,但只要我这样做浏览器=webdriver.Firefox()我得到错误:File"",line1,inFile"/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py",line134,in__init__self.service=Service(executable_path,log_path=lo