clientcookie/clientform and checking to see if a website accepted my login details

S

socialanxiety

alright, i'm coding a program that will log me into yahoo.com (so
far), now, the problem i have is that once i've submitted by login &
password, the program doesn't know whether yahoo.com accepted it.
"
response = ClientCookie.urlopen(form.click())
"

now, when i get an error, the contents of 'response' will be
different, ex: the contents of '<title>example</title>' will be
'<title>logged in!</title>'. is there any function that can search
through the code for that text to check if i'm logged in or not?

all help is appreciated
 
J

John J. Lee

alright, i'm coding a program that will log me into yahoo.com (so
far), now, the problem i have is that once i've submitted by login &
password, the program doesn't know whether yahoo.com accepted it.
"
response = ClientCookie.urlopen(form.click())
"

now, when i get an error, the contents of 'response' will be
different, ex: the contents of '<title>example</title>' will be
'<title>logged in!</title>'. is there any function that can search
through the code for that text to check if i'm logged in or not?

There's no general way to find out (regardless of whether you're using
Python or something else). So:

data = response.read()
logged_in = 'logged in!' in data
if logged_in:
print "logged in OK"


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top