Skip to content

Instantly share code, notes, and snippets.

@andirkh
Created January 16, 2019 13:19
Show Gist options
  • Select an option

  • Save andirkh/d0977eddede41e871bfa43400b44e4ec to your computer and use it in GitHub Desktop.

Select an option

Save andirkh/d0977eddede41e871bfa43400b44e4ec to your computer and use it in GitHub Desktop.
python download url from xml
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)
@andirkh

andirkh commented Jan 16, 2019

Copy link
Copy Markdown
Author

wget -i download.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment