Advertisement
illwill

Tindr_lookup.py

Aug 28th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import re
  4.  
  5. import urllib2
  6.  
  7. from urllib2 import Request, urlopen, HTTPError, URLError
  8.  
  9. from bs4 import BeautifulSoup
  10.  
  11. import requests
  12.  
  13.  
  14. def check_username(username):
  15.  
  16. site = "https://www.gotinder.com/@%s" % (username)
  17.  
  18. request = urllib2.Request(site) #build request
  19.  
  20. request.add_header('User-Agent', "poop 3.0") #use random user agent
  21.  
  22. page = urllib2.urlopen(request) #connect to website and get html data into variable
  23.  
  24. soup = BeautifulSoup(page, 'html.parser') #parse data into soup
  25.  
  26. #image = soup.findAll('img')[1].get('src')
  27.  
  28. #print(image)
  29.  
  30. print('Looking up Tindr user: %s')%(username)
  31.  
  32. if soup.body.findAll(text='Looking for Someone?'): #check if CAPTCHA was triggered
  33.  
  34. print("[X] "+"Profile Not Found!")
  35.  
  36. return
  37.  
  38. photo = soup.find("img", id="user-photo")
  39.  
  40. print('Picture: %s')%(photo['src'])
  41.  
  42. name = soup.find("span", id="name")
  43.  
  44. print ('Name: %s')%(name.text)
  45.  
  46. teaser = soup.find("span", id="teaser")
  47.  
  48. print ('Info: %s')%(teaser.text)
  49.  
  50. age = soup.find("span", id="age")
  51.  
  52. age = (age.text).replace(',','')
  53.  
  54. print ('Age:%s')%(age)
  55.  
  56.  
  57.  
  58. check_username('illwill')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement