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.
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()