Program to automate clicking on the new button on a chat website until the username matches certain conditions This is a python program that automates skipping through users on a chat website called 
talkwithstrangers using the Selenium Webdriver and BeautifulSoup modules of python.

The first part uses selenium to open the browser

from selenium import webdriver
driver = webdriver.Chrome('C:\SeleniumDrivers\chromedriver.exe')
userName = 'null'
driver.get('https://talkwithstranger.com/talk-to-strangers') 


The second part is a while loop that run while the username has not met the required conditions,

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)


The code is running fine but the problem is the efficiency and runtime.
Your third part is wrong, I think.

nonCompatible = 'female' not in name


will only run against the value of name at the time of execution, so nonCompatible will end up either True or False, and won't change unless you reset it elsewhere in the while loop.  You may want to either inline it:

while 'female' not in name:
    ...


or abstract it:

def nonCompatible(nym):
    return 'female' not in nym


while nonCompatible(name):
    ...