Advertisement
vinissh

praticaPython3

Oct 14th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.96 KB | None | 0 0
  1. import re
  2. import requests
  3. from bs4 import BeautifulSoup
  4.  
  5.  
  6. print('''\033[96m
  7.  
  8. ███████╗███████╗ █████╗ ██████╗  ██████╗██╗  ██╗    
  9. ██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██║  ██║    
  10. ███████╗█████╗  ███████║██████╔╝██║     ███████║    
  11. ╚════██║██╔══╝  ██╔══██║██╔══██╗██║     ██╔══██║    
  12. ███████║███████╗██║  ██║██║  ██║╚██████╗██║  ██║    
  13. ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ Version:0.0.1
  14.  
  15.  
  16.            +------------------------------------------------+
  17.            | Desenvolvedor : ViniciusP                      |
  18.            | Data de Criação: 06/10/2019                    |
  19.            | Github: https://github.com/vinissh             |
  20.            +------------------------------------------------+
  21. \033[00m''')
  22.  
  23.  
  24.  
  25.  
  26. fileFriend = open('InitialChatFriend2.txt')
  27. def RequestToFacebook(fileFriend):
  28.         try:
  29.                 dataFriends = str(fileFriend.read())
  30.                 searchId = re.findall(r'10000\w+', dataFriends)
  31.                 for friendsKeys in searchId:
  32.                         keyFriends = str(friendsKeys)
  33.                         urlRequest=('https://www.facebook.com/profile.php?id=' + keyFriends)
  34.                         cookies={
  35.                                 '_fbp':'fb.1.1570730773453.762378139',
  36.                                 'datr':'-OadXb2rvO7J-prqiybKg5dU',
  37.                                 'locale':'pt_BR',
  38.                                 'sb':'-OadXWykqiiWaHq4JeDwT9BN'}
  39.                         proxy={
  40.                                 '47.56.169.133':'8080'
  41.                         }
  42.  
  43.                         headers={
  44.  
  45.                                 'authority': 'www.facebook.com',
  46.                                 'method': 'POST',
  47.                                 'path': '/login/device-based/regular/login/',
  48.                                 'upgrade-insecure-requests': '1',
  49.                                 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36',
  50.                                 'viewport-width': '1366'}
  51.                        
  52.                         searchRequest = requests.post(urlRequest,headers=headers,cookies=cookies,proxies=proxy)
  53.                         searchPeoples = BeautifulSoup(searchRequest.text, 'html.parser')
  54.                         print(searchPeoples.find_all(id='pageTitle'))
  55.         except ConnectionError:
  56.                 print('Erro de conexão com a url')
  57. RequestToFacebook(fileFriend)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement