Fairly new to selenium Python so please go easy.
For:
<button class="slds-button slds-show" aria-haspopup="dialog"><div class="slds-icon-waffle"><div class="slds-r1"></div><div class="slds-r2"></div><div class="slds-r3"></div><div class="slds-r4"></div><div class="slds-r5"></div><div class="slds-r6"></div><div class="slds-r7"></div><div class="slds-r8"></div><div class="slds-r9"></div><span class="slds-assistive-text">App Launcher</span></div></button>
I'm trying to click on the button by getting the class:
applauncher = driver.find_element(By.CLASS_NAME, 'slds-button slds-show')
which results in a NoSuchElementException. I've tried putting a . in the class name to remove the whitespace and "" instead of single quotes. I usually have a wait in there but removed it for debugging, the command doesn't work with it anyway.
The thing is finding it by XPATH works absolutely fine:
applauncher = WebDriverWait(driver, 10).until(EC.element_to_be_clickable(("xpath", "//button[@class='slds-button slds-show']")))
Even though I already have a solution, I'd like to improve my understanding and figure out why finding the element by class name doesn't work. Thanks.