'How to extract Text from div class banner-text? [duplicate]
please support to extract this text from div class. I'm using the following code but it is not working.
print(WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//div[@class='Your object has been successfully created']//p"))).text)
Solution 1:[1]
This should work out:
var = WebDriverWait(driver, 20).until(EC.visibility_of_element_located(
(By.XPATH, "//div[@class='Your object has been successfully created']//p"))).text
print(var)
You also could try to just use the class with:
var = WebDriverWait(driver, 20).until(EC.visibility_of_element_located(
(By.CLASS_NAME, "banner-text"))).text
print(var)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
