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

Help with mechanize

P: n/a
I'm trying to use mechanize to read for a M$ mail server. I can get past the login page OK using:

import mechanize

b = mechanize.Browser()
b.open ('https://mail.hughes.com/owa/auth/logon.aspx?url=https://mail.hughes.com/OWA/&reason=0')
b.select_form(nr=0)
b['username']='myname'
b['password']='password'
b.submit()

Now it seems if I read b.links() I can see links to my mail. My question is, how do I now actually get the contents of this page?


Aug 6 '08 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Dnia Wed, 06 Aug 2008 07:16:37 -0400, Neal Becker napisał(a):
I'm trying to use mechanize to read for a M$ mail server. I can get past the login page OK using:
....
Now it seems if I read b.links() I can see links to my mail. My question is, how do I now actually get the contents of this page?

Have you tried follow_link() method?
In your case it should be something like:

response = b.follow_link(b.links()[0]) # I suppose links()
# returns a list or tuple
print response.info() # headers
print response.read() # body

IIRC, it's described in the documentation.

--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
Aug 6 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.