【发布时间】:2021-07-01 14:44:01
【问题描述】:
我在 Python 和 Colab 中使用 selenium。 我有一些在 spyder 中工作的代码,提取元素但在协作中给我错误
NoSuchElementException: Message: no such element: Unable to locate element:
什么是可能的解释,是否有可能解决这个问题?
【问题讨论】:
-
之前,尝试与元素交互放置一个 time.sleep(certain_time)。这将使元素有时间加载。虽然这不是最佳做法,但请看这里stackoverflow.com/questions/59130200/…
-
但这给了我另一个错误:
-
那个错误是什么?
-
WebDriverWait(driver, 4).until(EC.presence_of_element_located((By.XPATH, "//li[@class='style__CategoryItem-sc-8ncu0g-2 tZtCz']//span[text()='%s']" %(aaa[1])))).click()TimeoutException: Message:
标签: python selenium selenium-webdriver google-colaboratory