I\'ve done this with BeautifulSoup but it\'s a bit cumbersome, and I\'m trying to figure out if I can do it directly with Selenium.
Let\'s say I have the following H
Use find_elements_by_class_name() to get all blocks and find_element_by_xpath() to get title
and company
for each person:
persons = []
for person in driver.find_elements_by_class_name('person'):
title = person.find_element_by_xpath('.//div[@class="title"]/a').text
company = person.find_element_by_xpath('.//div[@class="company"]/a').text
persons.append({'title': title, 'company': company})