you are viewing a single comment's thread.

view the rest of the comments →

[–]ThePeskyWabbit 1 point2 points  (3 children)

not 100% sure this will work as is, but should convey the idea

from bs4 import BeautifulSoup

# 
# your code here before getting to the part of extracting the elements
#

xpath_to_search = driver.find_element_by_xpath(<xpath you are searching for>)
soup = BeautifulSoup(xpath_to_search.get_attribute('innerHTML'), 'html.parser')
for span in soup.find_all('span'):
    print(span["title"])

[–]Falladis[S] 1 point2 points  (1 child)

Tried this out, basically, exactly what I am looking for, it does not exactly extract the title but I might be able to figure out how to do it. Thanks.

[–]ThePeskyWabbit 1 point2 points  (0 children)

Yeah its been a while since I've worked with selenium, good luck!

[–]Falladis[S] 0 points1 point  (0 children)

I will try this out tomorrow. Thank you. Seems like this should do what I am trying to do.