Created
January 16, 2019 13:19
-
-
Save andirkh/d0977eddede41e871bfa43400b44e4ec to your computer and use it in GitHub Desktop.
python download url from xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| file = "./wordpress.xml" | |
| regex = "(?:http\:|https\:)?\/\/.*\.(?:png|jpg)" | |
| f = open(file, "r").read() | |
| # array | |
| url = re.findall(regex, f) | |
| newfile = open("./download.txt","w") | |
| for i in url: | |
| string = i + "\n" | |
| newfile.write(string) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wget -i download.txt