Mechanize hanging

K-Dawg kdawg44 at gmail.com
Wed Jan 21 20:21:06 EST 2009


Hi,

I am trying to use mechanize to connect and log into Yahoo!

Here is my code:

#c:\Python25\python
import re
import urllib
import urllib2
import mechanize

print "print1"
br = mechanize.Browser()
br.set_handle_robots(False)
br.open("https://login.yahoo.com/config/login?")

It is hanging at the open.  Eventually I have to just kill it and I get
this:

__init__.py
Traceback (most recent call last):
  File "C:\Documents and
Settings\kholleran\workspace\PythonPractice\src\PythonP
ractice\__init__.py", line 10, in <module>
    br.open("https://login.yahoo.com/config/login?")
  File
"C:\Python25\lib\site-packages\mechanize-0.1.9-py2.5.egg\mechanize\_mecha
nize.py", line 206, in open
  File
"C:\Python25\lib\site-packages\mechanize-0.1.9-py2.5.egg\mechanize\_mecha
nize.py", line 232, in _mech_open
  File
"C:\Python25\lib\site-packages\mechanize-0.1.9-py2.5.egg\mechanize\_opene
r.py", line 192, in open
  File
"C:\Python25\lib\site-packages\mechanize-0.1.9-py2.5.egg\mechanize\_http.
py", line 570, in http_response
KeyboardInterrupt

Which i am sure is not very helpful but I don't want to leave anything out.

Thanks for any help.

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090121/d3893d36/attachment.html>


More information about the Python-list mailing list