urllib accept-language doesn't have any effect
Diez B. Roggisch
deets at nospam.web.de
Wed Oct 15 10:49:50 EDT 2008
Martin Bachwerk wrote:
> Hi,
>
> yes, well my browser settings are set to display sites in following
> languages "en-gb" then "en".
>
> As a matter of fact, Google does indeed show me the German site first,
> before I click on "go to google.com" and it probably stores a cookie to
> remember that.
>
> But a site like gizmodo.com forwards me directly to the English site
> (even though they have a German version available). But the Python call
> returns the German version. How does that make sense?
I don't know. You need to have a look at what the browser communicates,
through a tool like tcpmon or wireshark. Once you've gathered all needed
header-information, you can mimic the same request using urllib.
Diez
More information about the Python-list
mailing list