我试图通过使用子流程的python脚本打开chrome,但它不允许我使用指定的用户数据目录,因此默认为默认的用户数据目录。我得到一个弹出错误,读“谷歌浏览器无法读写其数据目录”
代码:
if __name__ == '__main__':
subprocess.run([
'chrome.exe',
'--remote-debugging-port=9222',
'--user-data-dir="C:\\selenum\\ChromeProfile"'
])
我正在使用Windows10。如果我用git bash命令打开chrome
chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\selenum\ChromeProfile"
…那么它就可以正常工作了。我认为在用python脚本运行chrome时,这可能是一个权限问题,但不确定
目前没有回答
相关问题 更多 >
编程相关推荐