我已经成功地在MAC上加载了Chrome配置文件,并且尝试在Linux上复制相同的配置文件,但是没有成功(Debian)。我使用的是Python,下面的代码在MAC上运行得很好
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("user-data-dir=/Users/username/Library/Application Support/Google/Chrome")
driver = webdriver.Chrome('./chromedriver', options=chrome_options)
同样的代码在Debian上,只是不起作用。。。你知道吗
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--user-data-dir=/home/username/.config/google-chrome")
# I've tried also without the `--` but same outcome
# chrome_options.add_argument("user-data-dir=/home/username/.config/google-chrome")
driver = webdriver.Chrome('./chromedriver_linux', options=chrome_options)
我现在真的知道怎么了。我正在使用chromedriver 2.45https://chromedriver.storage.googleapis.com/index.html?path=2.45/,这个问题与“Debian GNU/Linux 9(stretch)”有关。。。你知道吗
在推出Chrome方面,它们都很管用。不同的是,在MAC上它加载配置文件,而在Debian上则不加载
有人知道为什么会这样吗?你知道吗
是的,在经历了很多麻烦之后,显然这与我使用CRD(Chrome Remote Desktop)连接Linux实例有关!你知道吗
实际上,您可以检查配置文件位置加载chrome://版本。当与CRD连接时,这将从通常的
/home/user/.config/google-chrome
更改为/home/user/.config/chrome-remote-desktop/chrome-profile/
我所需要做的就是基本上替换为CRD目录来获得我想要的所有配置文件信息!你知道吗
希望这对其他人有帮助!:)
相关问题 更多 >
编程相关推荐