Skip to content

Instantly share code, notes, and snippets.

@jesusalber1
Last active Mar 11, 2019
Embed
What would you like to do?
Open all found urls in default browser
import re
import webbrowser
text = """
Text with urls goes here. Let's open Google at https://google.com
"""
urls = re.findall('https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+', text)
for url in urls:
webbrowser.open(url)
#webbrowser.get('safari').open(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment