On 8/17/06, a <[EMAIL PROTECTED]> wrote: > > getting and storing favicon.ico as an image, problems > I need to get the favicon.ico using urllib2.urlretrive or somehting > like that
As we said before, use urlopen() from Python's urllib library to get the page you want. Then, check for these locations, in this order. 1. Look in the <head> element of the page for a <link> element that has "icon" as one of the space-separated values in its "rel" attribute, and get the favicon from the URI in its "href" attribute. (This is the standards-compliant method) 3. If not found, try to download from http://server.domain.ext/favicon.ico. (This is the non-standards-compliant, IE method) These are the only two defined methods for getting the favicon, as far as I know. -- Tim Lesher <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

