How do I use glob with urllib2?
So what I have been trying to acheive with no success is creating a list of file names with glob from two sources and comparing them and download file if it doesn't exist.
I can't get past the start because I am not sure how to tell glob to start at the end of the url or directory path.
This is where i was going.
import urllib2, urlparse, glob
def getfile(base, fileExt):
base = ('http://www.tvn.com.au/tvnlive/v1/system/modules/org.tvn.website/resources/sectionaltimes/')
# the files wanted end in _C.rtf
# for files on site not in /home/sayth/python/secFiles download
files = []
files = files.append(urllib2.urlopen(base + glob.glob('?_C.rtf')))
PS I checked with urllib that the full path was correct. I didn't include full print out but as you can see it works.
>>> import urllib
>>> data = urllib.urlopen('http://www.tvn.com.au/tvnlive/v1/system/modules/org.tvn.website/resources/sectionaltimes/110702Race01_C.rtf').read()
>>> print data
{\rtf1\ansi \deff1\deflang1033{\fonttbl{\f1\froman\fcharset0\fprq2 Arial;}}
\paperh11907\paperw16840\margt794\margb794\margl794\margr794\lndscpsxn\psz9\viewkind1\viewscale84