1

Image Output Here

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)

1 Answers1

2

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)