Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:32:01+00:00 2026-05-27T02:32:01+00:00

I am trying to login to this page using Python. I tried using the

  • 0

I am trying to login to this page using Python.

I tried using the steps described on this other Stack Overflow post, and got the following code:

import urllib, urllib2, cookielib

username = 'username'
password = 'password'

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
login_data = urllib.urlencode({'username' : username, 'j_password' : password})
opener.open('http://friends.cisv.org/index.cfm', login_data)
resp = opener.open('http://friends.cisv.org/index.cfm?fuseaction=activities.list')
print resp.read()

but that gave me the following output:

<SCRIPT LANGUAGE="JavaScript">
    alert('Sorry.  You need to log back in to continue. You will be returned to the home page when you click on OK.');
    document.location.href='index.cfm';
</SCRIPT>

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:32:02+00:00Added an answer on May 27, 2026 at 2:32 am

    I would recommend using the wonderful requests module.

    The code below will get you logged into the site and persist the cookies for the duration of the session.

    import requests
    import sys
    
    EMAIL = ''
    PASSWORD = ''
    
    URL = 'http://friends.cisv.org'
    
    def main():
        # Start a session so we can have persistant cookies
        session = requests.session(config={'verbose': sys.stderr})
    
        # This is the form data that the page sends when logging in
        login_data = {
            'loginemail': EMAIL,
            'loginpswd': PASSWORD,
            'submit': 'login',
        }
    
        # Authenticate
        r = session.post(URL, data=login_data)
    
        # Try accessing a page that requires you to be logged in
        r = session.get('http://friends.cisv.org/index.cfm?fuseaction=user.fullprofile')
    
    if __name__ == '__main__':
        main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to create a iPhone Objective C login page using PHP/MySQL to authenticate.
I am trying to build a login page using hibernate and struts2. My design
I am trying automate a login process to my web application using Selenium-Python Client
this is what I am trying to achieve here. I have a login page
Well, I am trying to login to a site using Python and mechanize. I've
I am trying to build openid login system for my website. To do this
I'm trying to login automatically in a website using Perl with WWW::Mechanize . What
I'm trying to login with the following controller action, but my login attempt keeps
I have a page that is trying to login a user. at the top
I keep getting 401 when trying to login via Oauth with Twitter. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.