I have python code and I need it to pass divs and get text from each div.
I have a loop, which looks like:
for i in range(friends_count):
found = WebDriverWait(driver, 10).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "div[class*=friends_list_bl]>div")))
(found is the highlighted div)
(It pass each div, I`ll show you only one)
Here you see one div (highlighted) of the list of divs. I need to take "Гимназия № 82" from here. (Where "class=friends_field").
I also have a similar code but it takes names from the divs. It looks like:
name = found[i].find_element(By.CLASS_NAME, "AvatarRich__img").get_attribute("alt")
But I can’t think of any way to implement it with this.
P.S: I just need to make XPATH from the highest div on the screenshot, to the very bottom
Can anyone solve this?
2
Answers
I solved my question by using:
I’m not sure if I understand you question. If you went to take the div from the bottom using as reference the top div you can use an XPATH as follows: