By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,660 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,660 IT Pros & Developers. It's quick & easy.

Saving tif file from tricky webserver

P: n/a
Greetings,

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

http://patimg1.uspto.gov/.DImg?Docid...y=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?
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
schweet1 schrieb:
Greetings,

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

http://patimg1.uspto.gov/.DImg?Docid...y=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
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.