Monday, November 16, 2015

Python: Retrieve files from URL link

file-retrieve-via-url.py
#!/usr/bin/env python
import urllib
from datetime import datetime

saveFileName = "Sydney-Auction-Result-"+datetime.now().strftime("%Y%m%d%H%M%S")+".pdf"
urllib.urlretrieve ("http://domainmastheads.homepriceguide.com.au/saturday_auction_results/Sydney.pdf",saveFileName )
saveFileName = "Adelaide-Auction-Result-"+datetime.now().strftime("%Y%m%d%H%M%S")+".pdf"
urllib.urlretrieve ("http://domainmastheads.homepriceguide.com.au/saturday_auction_results/Adelaide.pdf",saveFileName )
saveFileName = "Melbourne-Auction-Result-"+datetime.now().strftime("%Y%m%d%H%M%S")+".pdf"
urllib.urlretrieve ("http://domainmastheads.homepriceguide.com.au/saturday_auction_results/Melbourne.pdf",saveFileName )
saveFileName = "Brisbane-Auction-Result-"+datetime.now().strftime("%Y%m%d%H%M%S")+".pdf"
urllib.urlretrieve ("http://domainmastheads.homepriceguide.com.au/saturday_auction_results/Brisbane.pdf",saveFileName )
#saveFileName = "Sydney-Domain-Auction-Result-"+datetime.now().strftime("%Y%m%d%H%M%S")+".pdf"
#urllib.urlretrieve ("http://www.domain.com.au/apm/saturday_auction_results/Sydney_Domain.pdf",saveFileName )

No comments: