Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from pyquery import PyQuery
- username=''
- password=''
- session = requests.session()
- response = session.get('https://facebook.com')
- dom = PyQuery(response.text)
- lsd = dom('[name="lsd"]').val() # for login lsd need to access
- # Perform the login request
- response = session.post('https://www.facebook.com/login.php?login_attempt=1', data={
- 'lsd': lsd,
- 'email': username,
- 'pass': password,
- 'default_persistent': '0',
- 'timezone': '-60',
- 'lgndim': '',
- 'lgnrnd': '',
- 'lgnjs': '',
- 'locale':'en_GB',
- 'qsstamp': ''
- })
- check = PyQuery(response.content)
- if str(check('[id="loginbutton"]').val())=='1': # checking the html content that login button is disapera or not
- print('Username or password worng. Enter correct username and password')
- exit(0)
- print('Login')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement