Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 网络浏览器chrome,can';t在新窗口中打开URL,将URL作为选项卡持续打开_Python_Google Chrome - Fatal编程技术网

Python 网络浏览器chrome,can';t在新窗口中打开URL,将URL作为选项卡持续打开

Python 网络浏览器chrome,can';t在新窗口中打开URL,将URL作为选项卡持续打开,python,google-chrome,Python,Google Chrome,我正在尝试在新窗口中打开URL。我不能使用selenium,因为它不会被登录到Google 我的默认浏览器是使用Windows 10的Chrome,我已经打开了3个Chrome窗口,每个窗口都有多个选项卡 以下是我在Python 3.6上的代码: import webbrowser url = 'https://google.com' open_google = webbrowser.open('https://google.com', new=1) open_google = webbro

我正在尝试在新窗口中打开URL。我不能使用selenium,因为它不会被登录到Google

我的默认浏览器是使用Windows 10的Chrome,我已经打开了3个Chrome窗口,每个窗口都有多个选项卡

以下是我在Python 3.6上的代码:

import webbrowser

url = 'https://google.com'

open_google = webbrowser.open('https://google.com', new=1)
open_google = webbrowser.open_new('https://google.com')

这两个选项都在当前窗口中为我提供了一个新选项卡,而不是一个新窗口。为什么会这样?这是Chrome中的设置吗?

使用os.system或子流程打开一个新窗口,然后使用webbrowser获取要在那里打开的URL/应用程序如何

比如:

import subprocess
command = "cmd /c start chrome http://www.google.com --new-window"
subprocess.Popen(command, shell=True)
然后做:

open_google = webbrowser.open('https://google.com', new=1)

使用os.system或subprocess打开一个新窗口,然后使用webbrowser获取要在那里打开的URL/应用程序,怎么样

比如:

import subprocess
command = "cmd /c start chrome http://www.google.com --new-window"
subprocess.Popen(command, shell=True)
然后做:

open_google = webbrowser.open('https://google.com', new=1)

在阅读了一些内容之后,似乎没有办法不使用Seleniummaybe try
webbrowser.open('https://google.com --新窗口“)
。或者简单地使用
subprocess
os.system()
而不是
webbrowser
在读了一点之后,似乎没有办法不使用Seleniummaybe尝试
webbrowser.open('https://google.com --新窗口“)
。或者简单地使用
子流程
os.system()
而不是
webbrowser