Issue
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
. . .
x = (
WebDriverWait(driver, 120)
.until(
EC.presence_of_element_located(
(
By.XPATH,
'//*[@id="root"]/div[2]/div[3]/div/div[6]/div/section[1]/div[2]/ul',
)
)
)
.find_element(
by=By.TAG_NAME,
value="li",
)
)
print(x)
The output I wanted to extract all list from <ul>
tag from html, but the output was <selenium.webdriver.remote.webelement.WebElement (session="2cb650732c8ccc1fbe4eb77febc4a449", element="3556f3cc-216a-49c6-9edf-5d478551cfdc")>
.
The list that I want to extract
Solution
To get a list instead of single element try to replace
EC.presence_of_element_located
with
EC.presence_of_all_elements_located
Answered By - JaSON
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.