如何使用webbrowser模块在已有浏览器窗口中打开网址?
我正在使用webbrowser这个Python模块来在Internet Explorer中打开图片。具体来说,我使用的是webbrowser.open('C:...', new=0)
这个命令。
但是,尽管我设置了new=0
,我的链接总是会在一个新的浏览器窗口中打开。
我该怎么做才能让我的链接在已经打开的浏览器窗口中打开呢?
谢谢你的帮助。
1 个回答
1
试试使用 open_new_tab。
可以用这个命令:webbrowser.open_new_tab(url)
Open url in a new page (“tab”) of the default browser, if possible, otherwise equivalent to open_new().