in reply to Re: Can't get Mechanize to download file
in thread Can't get Mechanize to download file

If it handles cookies correctly as you say then why doesn't it work?

As I said in my question, it does work in my browser.

When I run Wireshark I can see it getting a cookie but I don't know how to emulate this in Mechanize.

  • Comment on Re^2: Can't get Mechanize to download file

Replies are listed 'Best First'.
Re^3: Can't get Mechanize to download file
by Anonymous Monk on Mar 11, 2016 at 23:31 UTC

    If it handles cookies correctly as you say then why doesn't it work?

    Because of all the reasons explained in the FAQ , but basically,

    because websites still discriminate based on browser identification headers

    cookies are often set through javascript or web bugs, and mech doesn't javascript or load/GET images, you have to help it do those things

    When I run Wireshark I can see it getting a cookie but I don't know how to emulate this in Mechanize.

    Have you checked to see if mechanize is already getting this cookie?

    Have you checked to see if mechanize is getting that same url?