a guest May 17th, 2018 89 Never
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'
- while 'female' not in userName or 'Female' not in userName:
- 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)
RAW Paste Data