开发者

Python - Opening Multible Tabs in Internet Explorer

开发者 https://www.devze.com 2023-01-28 01:50 出处:网络
I\'m using this code to open Google in IE... ie = webbrowser.get(\'C:\\\\Progra开发者_开发技巧m Files\\\\Internet Explorer\\\\IEXPLORE.exe\')

I'm using this code to open Google in IE...

ie = webbrowser.get('C:\\Progra开发者_开发技巧m Files\\Internet Explorer\\IEXPLORE.exe')

ie.open('http://google.com")

I need to open multiple tabs though, so how could I do that?


I haven't tested with IE, but this is the way it's supposed to work:

ie.open_new_tab(url1)
ie.open_new_tab(url2)
ie.open_new_tab(url3)


ie.open_new_tab('http://www.stackoverflow.com')

See http://docs.python.org/library/webbrowser.html#webbrowser.open_new_tab.


I think this might help you! You just need to wait the main windows load to open a new tab.

import win32com.client, time import webbrowser webbrowser.open_new_tab('http://www.yahoo.com') time.sleep(2) #wait 2 sec. webbrowser.open_new_tab('http://www.google.com.br')

0

精彩评论

暂无评论...
验证码 换一张
取 消