0

Hi, I want to make a program that opens a url, finds the data I need, and returns it to me. The problem is I have to login to the website, and I don't know how to do this. I've looked at some examples, and this is what I have so far.

import urllib
import urllib2

# Build opener with HTTPCookieProcessor
o = urllib2.build_opener( urllib2.HTTPCookieProcessor() )
urllib2.install_opener( o )

# Parameters to submit
p = urllib.urlencode( { 'stuident': 'stuid', 'stupassword': 'password' } )

# Login with params
f = o.open( 'https://webconnect.bloomfield.org/Zangle/StudentConnect/',  p )
data = f.read()
print data
f.close()

It doesn't give any errors but it doesn't login either.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by siddhant3s
0

I still can't get it to work. I tried using it with different sites and its the same thing: there's no error but it doesn't log in.

0

Is you password correct?
Next time you say "It doesn't work", post the code were you trying so we can simulate it on our machines.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.