1

I'm having trouble staying logged into a website using python. I found this question (Login to website using urllib2 - Python 2.7) for python2, which I updated to python3 changing cookieLib to http.cookiejar and urllib2 to urllib.request (among other updates). It seems to log me in, but when I reopen the page with urlopen, I'm not logged in. There was a similar comment to this on the question but it went unanswered. Any help is appreciated.

mtrojak2
  • 113
  • 3
  • 1
    can you use requests instead? A requests Session object handles all this for you – SuperStew Aug 23 '19 at 19:47
  • have you tried release_conn = False (https://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool) Also, if you are not tied to urllib, you might find requests easier - specifically using Sessions (https://2.python-requests.org/en/master/user/advanced/) – SteveJ Aug 23 '19 at 19:48
  • Tried requests, and its much less complicated and insofar, works! Thanks! – mtrojak2 Aug 24 '19 at 21:35

0 Answers0