daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest May 17th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from selenium import webdriver
  2. driver = webdriver.Chrome('C:SeleniumDriverschromedriver.exe')
  3. userName = 'null'
  4. driver.get('https://talkwithstranger.com/talk-to-strangers')
  5.    
  6. while 'female' not in userName or 'Female' not in userName:
  7.     driver.get('https://talkwithstranger.com/talk-to-strangers')
  8.     html = driver.execute_script("return document.documentElement.innerHTML;")
  9.  
  10.     from bs4 import BeautifulSoup
  11.     soup = BeautifulSoup(html, 'html5lib')
  12.     userVal = soup.find(class_='alert text-center alert-success')
  13.     userNames =  userVal.find_all('b')
  14.  
  15.     def getName(userNames):
  16.         for name in userNames:
  17.             return name.prettify()
  18.  
  19.     userName = getName(userNames)
RAW Paste Data
Top