Feb-08-2019, 02:34 AM
I got it. Thanks
import re # Target file to search target_file = 'randomtextfile.txt' # Open the target file in Read mode target_open = open(target_file, 'r') # Read the file read_file = target_open.read() # No idea what this does....... urls = re.findall('(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+', read_file) # Print urls in list one at a time. Top to bottom. for i in urls: print(i)