Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- driver = webdriver.Chrome('C:SeleniumDriverschromedriver.exe')
- userName = 'null'
- driver.get('https://talkwithstranger.com/talk-to-strangers')
- while 'female' not in userName or 'Female' not in userName:
- driver.get('https://talkwithstranger.com/talk-to-strangers')
- html = driver.execute_script("return document.documentElement.innerHTML;")
- from bs4 import BeautifulSoup
- soup = BeautifulSoup(html, 'html5lib')
- userVal = soup.find(class_='alert text-center alert-success')
- userNames = userVal.find_all('b')
- def getName(userNames):
- for name in userNames:
- return name.prettify()
- userName = getName(userNames)
Add Comment
Please, Sign In to add comment