Advertisement
durdin

FacebookLoginOnly

Oct 2nd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import requests
  2. from pyquery import PyQuery
  3. username=''
  4. password=''
  5. session = requests.session()
  6. response = session.get('https://facebook.com')
  7. dom = PyQuery(response.text)
  8.  
  9. lsd = dom('[name="lsd"]').val() # for login lsd need to access
  10.  
  11. # Perform the login request
  12. response = session.post('https://www.facebook.com/login.php?login_attempt=1', data={
  13.     'lsd': lsd,
  14.     'email': username,
  15.     'pass': password,
  16.     'default_persistent': '0',
  17.     'timezone': '-60',
  18.     'lgndim': '',
  19.     'lgnrnd': '',
  20.     'lgnjs': '',
  21.     'locale':'en_GB',
  22.     'qsstamp': ''
  23. })
  24.  
  25. check = PyQuery(response.content)
  26. if str(check('[id="loginbutton"]').val())=='1': # checking the html content that login button is disapera or not
  27.     print('Username or password worng. Enter correct username and password')
  28.     exit(0)
  29. print('Login')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement