如何在没有显色剂的情况下完全使用普通铬,硒python ,不重复。我正在使用python 3.8.8,os是windows 7的终极版本,py魅力作为IDE,chrome版本在96左右。我的问题是,每当我使用python脚本来抓取网站时,它就会使用chromedriver,并且当我指定下面给出的内容时:
options = Options ()
options.add_argument(r"user-data-dir=my chrome path which is not Executable instead the user data")
#this works but w
为了安装Selenium,步骤3 on (表示需要在路径中安装chromedriver文件)。我在一台无法直接访问系统路径的工作计算机上。我尝试在本地路径(我在Windows7上)中列出变量链,如下所示: C:\Users\mknerr\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\mknerr\AppData\Local\Programs\Python\Python36-32\;C:\Users\mknerr\AppData\Local\atom\bin;C:\Users\mknerr\Programs\ChromeD
我正在创建一个跨平台python脚本,它使用selenium执行一些命令。我有两个问题:
为什么下面的脚本可以在windows上工作,但是在Raspberry操作系统32位上却不能工作呢?唯一的方法是移除webdriver,但这需要手动安装webdriver。我用的是覆盆子3
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager
我有一个简单的Python脚本,它使用selenium和webdriver在Chrome窗口中打开Facebook并自动登录。当我运行它时,Chromedriver控制台窗口会打开,甚至在整个程序完成执行后也会保持打开状态,直到我自己将其关闭。
有没有办法隐藏这个控制台窗口?我尝试为我的脚本保留一个".pyw“扩展名,但这没有帮助,因为它不是脚本的控制台窗口,而是我希望隐藏的ChromeDriver子进程的控制台窗口。
我在这上面找不到任何资源。我认为我可能需要修改chrome webdriver源代码,但我不知道如何修改。这是我的代码:
from selenium import we
我目前正在学习Selenium4.0,并设置了一个基本脚本,该脚本将单击Python网站上的一个按钮。我用的是Chrome网络驱动程序。但是,每当我运行我的代码,一个chrome窗口打开到Python网站,然后立即关闭。我怎么把它打开?
浏览器版本和webdriver版本是相同的,我甚至尝试过边缘webdriver和重新安装Chrome。我甚至尝试下载一个webdriver到我的本地目录,但这也不起作用。下面是我当前的脚本:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
我刚刚开始使用Selenium,并且能够加载google,但是现在当我运行以下代码时,它会产生错误:
selenium.common.exceptions.WebDriverException: Message 'chromedriver' executable needs
to be PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
为什么它说"C:Users/Colin/Python/chromedriver“不是路径?
from selenium import we
我刚开始试用Selenium,在使用ChromeDriver运行脚本时遇到了问题。我所要做的就是打开浏览器并访问脚本中的url。
问题是,浏览器打开了,但随后什么也没有发生,浏览器只是坐在那里什么也不做。
最初我只有下面这行代码,但是ChromeDriver一直在崩溃,我添加了你在主脚本中看到的代码行,崩溃已经停止了,但它仍然不能工作。
第一个脚本:
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace WebDriverDemo
{
class Program
{
我在ubuntu上运行python3脚本
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu') # Last I checked this was necessary.
driver = webdriver.Chrome("/home
我用selenium编写了一个小型python脚本来搜索Google并打开第一个链接,但是每当我运行这个脚本时,它就会打开一个控制台,打开一个新的Chrome窗口,并在那个Chrome窗口中运行这个脚本。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import pyautogui
def main():
setup()
# open Chrome and open Google
def setup():
driver = webdriver.Chrome(r&
以前,脚本运行良好。但是,在下面的env中运行自动化脚本时,我最近遇到了错误。
操作系统版本: Windows 7 selenium版本: selenium-java-2.37.0Driver版本: ChromeDriver 2.8
犯错误,如:
Starting ChromeDriver (v2.8.241075) on port 22931
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the re
我想在Chromebook上使用Chromedriver运行Selenium测试,但我无法让它工作。
设置
我安装了和。chromebrew提供了用于virtualenv和Python3.6的包,加上pip install Selenium,我获得了Selenium。从中我知道色度驱动器在/usr/local/chromedriver中。称之为:
chronos@localhost /usr/local/chromedriver $ chromedriver
Starting ChromeDriver 2.24 on port 9515
Only local connections are