简体   繁体   中英

Python - Opening Multible Tabs in Internet Explorer

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

ie = webbrowser.get('C:\\Program 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)

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')

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

请参阅http://docs.python.org/library/webbrowser.html#webbrowser.open_new_tab

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM