Python 网络浏览器chrome,can';t在新窗口中打开URL,将URL作为选项卡持续打开
我正在尝试在新窗口中打开URL。我不能使用selenium,因为它不会被登录到Google 我的默认浏览器是使用Windows 10的Chrome,我已经打开了3个Chrome窗口,每个窗口都有多个选项卡 以下是我在Python 3.6上的代码: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
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