Program to automate skipping users on a chat website until the username meets certain conditions (v.2.0)
There are instructions you should not repeat inside the loop, and they should be written before it:


from bs4 import BeautifulSoup should be written much above in your code, within the import section.
getName() should be defined outside the loop, and named get_names() according to the naming conventions (actually it should be named get_names() because you are dealing with more than one name)


You do not get all female users:


When you run userName = getName(userNames), you are getting the last female user whereas you are obviously looking for all of them. So you should create a list of usernames and append useName (should be written user_name) to it whenever found.


Main performance issue:


You quickly refresh the page using driver.get('https://talkwithstranger.com/talk-to-strangers') whereas when I visited the link, it does not refresh as frequently as you do it. In opposite, most often I am kicked out of the room and had to wait a dozen of seconds. I think it also depends on whether there are users or not. In all cases, you are refreshing the page too quickly and you have to study the behavior of the website to decide on the strategy and criteria upon which you can refresh the page