0

I've been working at this for nearly a week and just don't understand why it isn't working. The code works great in Windows, but once I move it to Linux, it doesn't work.

I'm basically using mechanize to login automatically to a website. The website requires cookies, however, and I can't get Linux to accept cookies using the mechanize classes. Windows works great!

Here's my code...pretty basic. Of course there is more, but this is the login part.

self.b = Browser()
self.b.open(URL_LOGIN)
self.b.select_form('Form1')
self.b["USER"] = USER
self.b["PASS"] = PASSWORD
login_response = self.b.submit()
print login_response.read()

Here is what I've tried so far.

Different versions of Ubuntu (8.04 and 9.04) with different versions of Python (2.5.2 and 2.6.2)

Install mechanize from apt sources and install mechanize from website using python setup.py install

Expliciting requiring cookies with:

self.cj = CookieJar()
self.b.set_cookiejar(cj)

NOTHING WORKS! Are there any ideas why? Please?!

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by bond00
0

bump...any ideas? This is driving me nuts. I've now tried different distributions of Linux as well.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.