Issue
I would like to take the word "buy"
browser.find_element_by_xpath("//*[@id='js-commentaire']")
print(commentaire)
and i also did
browser.find_element_by_id("js-commentaire")
print(commentaire)
This the source code
"div class="col-6 form-control form-control-sm overflow-auto" id="js-commentaire"> buy</div"
Solution
You will need following libs:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
And then try this:
my_element = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//input[@id='js-commentaire']")))
print(my_element.text)
Or
my_element = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//input[@id='js-commentaire']")))
print(my_element.get_attribute('textContent'))
Answered By - Jaky Ruby
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.