Saving tif file from tricky webserver

S

schweet1

Greetings,

I am attempting to automate accessing and saving a file (a TIF) from
the following URL:

http://patimg1.uspto.gov/.DImg?Docid=US007376435&PageNum=1&IDKey=E21184B8FAD5

I have tried some methods using urllib, httplib, and
web32com.client(InternetExplorer), but haven't been successful.
Currently I am using (in Python 2.5)

import webbrowser

url = [see above]

webbrowser.open(url, new=0, autoraise=0)

When this is run a windows popup dialog opens asking me to Open, Save,
or Cancel. However, if I query multiple such URLs, I do not want to
have to respond manually. Is there a way I can use Python to save the
TIF?
 
D

Diez B. Roggisch

schweet1 said:
Greetings,

I am attempting to automate accessing and saving a file (a TIF) from
the following URL:

http://patimg1.uspto.gov/.DImg?Docid=US007376435&PageNum=1&IDKey=E21184B8FAD5

I have tried some methods using urllib, httplib, and
web32com.client(InternetExplorer), but haven't been successful.
Currently I am using (in Python 2.5)

import webbrowser

url = [see above]

webbrowser.open(url, new=0, autoraise=0)

When this is run a windows popup dialog opens asking me to Open, Save,
or Cancel. However, if I query multiple such URLs, I do not want to
have to respond manually. Is there a way I can use Python to save the
TIF?

You need to figure out what really becomes the download url, and use
that. Use e.g. http live headers for firefox to get that information.

If the server needs the form-submitting stuff to actually grant access
to the TIFF, you might need to use mechanize to talk to the site as if
you were a browser.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top