Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

find allurl in text python

import re
text = '<p>Contents :</p><a href="https://w3resource.com">Python Examples</a><a href="http://github.com">Even More Examples</a>'
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', text)
print("Original string: ",text)
print("Urls: ",urls)
Comment

PREVIOUS NEXT
Code Example
Python :: add headers tp requests python 
Python :: python slice an array 
Python :: install python selenium webdriver 
Python :: pandas replace space with underscore in column names 
Python :: python get nth letter of alphabet 
Python :: python list of all tkinter events 
Python :: remove spaces from input python 
Python :: python prime check 
Python :: python run as service windows 
Python :: python requests cookies 
Python :: string to ascii value python 
Python :: python 3.9.5 installed update default version 
Python :: how to save bulk create in django 
Python :: python pip install 
Python :: pip install specific version 
Python :: how to increase bar width in python matplogtlib 
Python :: python df select first x columns 
Python :: python check if number 
Python :: TinyDB 
Python :: python get dict values as list 
Python :: bot ping discord.py 
Python :: find a file in python 
Python :: append element to an array python 
Python :: django template for range 
Python :: remove first 2 rows in pandas 
Python :: python execute time 
Python :: How to Create Caesar Cipher Using Python 
Python :: pthon - progressbar 
Python :: convert keys to values in python 
Python :: Creating a list with list comprehensions 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =