| | |
pycurl cookies
![]() |
•
•
Join Date: Jun 2008
Posts: 26
Reputation:
Solved Threads: 0
My problem is that I do not see cookies being captured with this forum submission that I have setup. Does anyone know what I am doing wrong? Any help is appreciated, thanks.
Python Syntax (Toggle Plain Text)
def main(): # Request post page dev_null = StringIO.StringIO() pycurlConnect = pycurl.Curl() pycurlConnect.setopt(pycurl.USERAGENT, USER_AGENT) pycurlConnect.setopt(pycurl.URL, LOGIN_URL) pycurlConnect.setopt(pycurl.REFERER, REFERER) pycurlConnect.setopt(pycurl.POSTFIELDS, POST_DATA) pycurlConnect.setopt(pycurl.HTTPHEADER, HEADERS) pycurlConnect.setopt(pycurl.WRITEFUNCTION, dev_null.write) pycurlConnect.setopt(pycurl.COOKIEFILE, 'cookies.txt') pycurlConnect.setopt(pycurl.COOKIEJAR, 'cookies.txt') pycurlConnect.setopt(pycurl.POST, 1) pycurlConnect.setopt(pycurl.VERBOSE, 1) pycurlConnect.setopt(pycurl.FOLLOWLOCATION, 1) pycurlConnect.perform() print pycurlConnect.getinfo(pycurl.HTTP_CODE), pycurlConnect.getinfo(pycurl.EFFECTIVE_URL) print pycurlConnect.getinfo(pycurl.INFO_COOKIELIST) # Close connections dev_null.close() pycurlConnect.close()
![]() |
Similar Threads
- Attribute error, Cookies not found! (Python)
Other Threads in the Python Forum
- Previous Thread: API Maker
- Next Thread: tkinter button widget - passing parameter to function
| Thread Tools | Search this Thread |
alarm ansi anydbm app assignment backend beginner binary bluetooth character cipher cmd coordinates curves customdialog cx-freeze data decimals development directory exe feet file float format function generator getvalue gnu halp handling heads homework http ideas input ip itunes java keycontrol leftmouse line linux list lists loop maintain maze millimeter module mouse number numbers output parsing path pointer prime programming push py2exe pygame pymailer python queue random recursion recursive schedule screensaverloopinactive script slicenotation sqlite ssh statistics string strings sudokusolver text thread time tlapse tooltip tuple type ubuntu unicode url urllib urllib2 variable ventrilo vigenere web webservice wikipedia write wxpython xlib xlwt






