Open a browser URL using Python


import modules

import webbrowser


create dummy dataframe

#select the url you want to open
url = 'http://docs.python.org/'
#set browser path
chrome_path = 'open -a /Applications/Google\ Chrome.app %s'
#open browser, search URL
webbrowser.get(chrome_path).open(url)

Your browser should open after running the above.
Your Chrome path may vary, so if you need to debug I would recommend starting there.



Ace your next data science interview

Get better at data science interviews by solving a few questions per week



Find a bug? Submit a suggested change on Github, or message me on Twitter.