Python: generic webbrowser.get().open() for chrome.exe does not work

前端 未结 6 1461
天命终不由人
天命终不由人 2020-12-11 09:48

I am on Python 2.7 (Win 8.1 x64) and I want to open a URL in Chrome. As Chrome is only natively supported in 3.3+, I was trying a generic call:

import webbro         


        
6条回答
  •  时光取名叫无心
    2020-12-11 10:32

    Worked for me

    code snippet:

    import webbrowser
    
    chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
    webbrowser.get(chrome_path).open('http://google.com')
    

提交回复
热议问题