Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- inputFile=open('/path/to/file.txt', 'r')
- outputFile=open('/path/to/destination/file.txt', 'w')
- for line in inputFile:
- matches=re.findall(r'<img[^>]*src="([^"])"[^>]*>', line)
- if type(matches)=str:
- outputFile.write(matches)
- continue
- for match in matches:
- outputFile.write(match)
- inputFile.close()
- outputFile.close()
Advertisement
Add Comment
Please, Sign In to add comment