How to find elements that do not include a certain class name with selenium and python
问题 I want to find all the elements that contain a certain class name but skip the ones the also contain another class name beside the one that i am searching for I have the element <div class="examplenameA"> and the element <div class="examplenameA examplenameB"> At the moment i am doing this to overcome my problem: items = driver.find_elements_by_class_name('examplenameA') for item in items: cname = item.get_attribute('class') if 'examplenameB' in cname: pass else: rest of code I only want the