import requests url = 'http://example.com/login' payload = {'username': 'admin', 'password': 'password'} response = requests.post(url, data=payload) if 'Welcome' in response.text: print('Login successful!') else: print('Login failed.')