Oct-14-2018, 11:42 AM
Hey.I try to write a class that has url, login and password, and also cookies and content and I dont know how to approach this task, doing it without classes is easy but I have to learn this too.
class loginTest(): def __init__(self): s = requests.Session() def login(self,login_user,login_pass): data = {'username': login_user,'password': login_pass} return self.s.post('targetURL', data=data) def showMe(self,cookies,content): request = self.s.get("targetURL") content = self.s.content cookies = self.s.cookies.get_dict() print(content,cookies) a = loginTest() a.login a.showMe