T
T
tex6202017-08-10 22:55:17
Python
tex620, 2017-08-10 22:55:17

How to parse python grab response correctly?

Such a question, I'm trying to make a parser for VKontakte accounts in python (python).
I'm stuck on the function of validating the login:password pair
here is the function

from grab import *

def isValid(login, passw):
    
    grab = Grab(log_file='out.html')
    grab.go("https://vk.com/login")
    grab.set_input("email", login)
    grab.set_input("pass", passw)
    grab.submit()

    #если логин успешный то return 1 иначе return 0

if the login is successful, then my VK page appears in out.html and an indication of my VKontakte ID
Question: how to parse the answer and find out programmatically whether the login was successful or not
All hope is for you)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question