| | |
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 |
abrupt alarm ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib






