wait = WebDriverWait(driver, 15)
try:
element = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'div.scmp.scmp_Dialog-wrapper > div > div.scmp_Buttons-wrapper > button.scmp_Button.scmp_Button--intro-submit.scmp_Button--submit'))).click()
except TimeoutException as ex:
print('No element')
driver.save_screenshot('wtf.png')
driver.close()
wait = WebDriverWait(driver, 10)
element = wait.until(EC.element_to_be_clickable((By.XPATH, '/html/body/div[20]//div[2]/div/div[2]/button[2]'))).click()
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
Backtrace:
Ordinal0 [0x00486463+2188387]
Ordinal0 [0x0041E461+1762401]
..................................................
RtlSubscribeWnfStateChangeNotification [0x76F81B69+1081]
RtlSubscribeWnfStateChangeNotification [0x76F81B34+1028]
<span class="cart-company-lg__list-link text-body font-weight-400"><a href="https://mokoshaua.com/" target="_blank">https://mokoshaua.com/</a> , <a href="https://www.facebook.com/MokoshaCheese" target="_blank">https://www.facebook.com/MokoshaCheese</a> , <a href="https://www.instagram.com/mokosha_cheese/" target="_blank">https://www.instagram.com/mokosha_cheese/</a></span>
Try Except дает No element
Перечитал ветку:
https://github.com/SeleniumHQ/selenium/issues/5869
Испробовал разные методы, никуда не продвинулся.
Вычитал, что есть ShadowRoot (Open) и ShadowRoot (Closed). Мой случай второй.
В сети есть обсуждения такого же вопроса на С и Java, но решения не нашли.
Прошу помощи и строго не судить. Я пока еще только обучаюсь