📌  相关文章
📜  在 python 中编写代码以在单独的浏览器选项卡中打开页面上的所有链接 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:08.314000             🧑  作者: Mango

代码示例1
import webbrowser
url = 'http://www.stackoverflow.com'
url2 = 'http://www.stackexchange.com'

def main():
    webbrowser.open(url2) # To open new window
    print('Opening Stack Exchange website!')
    webbrowser.open_new_tab(url) # To open in new tab
    print('Opening Stack Overflow website in a new tab!')

if __name__ == '__main__':
    main()