Answer the question
In order to leave comments, you need to log in
How to pull this value using Python Selenium Webdriver?
Hello!
I can’t pull out the number of people who voted from this site
Product name and link I pull out without problems.
*Ignore the structure of the code, i and loops will come in handy later
product_block = driver.find_element_by_css_selector("ul[class*='postsList']")
li_tags = product_block.find_elements_by_tag_name("li")
i = 1
while i < len(li_tags):
for li in li_tags:
name = li.find_element_by_css_selector("h2").text
link = li.find_element_by_css_selector("a").get_attribute("href")
#print(name)
#print(link)
i = i+1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question