I want to learn the skill to log in websites with Python, so I copy other's code then try to understand them.
I've write several web crawls which don't need to post data to the websites by myself.
But this time, when I try to learn crawls that need post data, Python doesn't work.
It's the wrong message from Windows Command Line:
C:\Python26\lib\cookielib.py:1579: UserWarning: cookielib bug!
Traceback (most recent call last):
File "C:\Python26\lib\cookielib.py", line 1577, in make_cookies
parse_ns_headers(ns_hdrs), request)
File "C:\Python26\lib\cookielib.py", line 1534, in _cookies_from_attrs_set
cookie = self._cookie_from_cookie_tuple(tup, request)
File "C:\Python26\lib\cookielib.py", line 1527, in _cookie_from_cookie_tuple
rest)
File "C:\Python26\lib\cookielib.py", line 764, in __init__
self._rest = copy.copy(rest)
AttributeError: 'module' object has no attribute 'copy'
_warn_unhandled_exception()
Actually, I have tried to use Python2.7.6 and Python2.6 and refresh 2.7.6 for times.
The code that I copied is from http://www.oschina.net/code/snippet_1253232_26503.
This code is right because lots of people run this code .
I provide an account:
Email='13018015260'(Also can be telephone number in this site),password='qwerty'
The code is not the problem, but the Python itself. Once I use cookielib in code, Python on my computer doesn't work!
Sorry for my poor English, I want to know the answer, because I even can't find similar problems in Google!