Mar-30-2017, 01:32 AM
I dont know what do you want to use as the keys in your dictionary, but equivalent of your csv would be probably list containing your "rows"
elements = driver.find_elements_by_xpath("//ul[@id='AssociationList_listbox']/li") elements_list = [] for element in elements: elements_list.append(str(element.text))If you had some unique (and hashable) key for each element, you could just change elements_list to a dictionary and instead of appending use
elements_dict[key] = str(element.text)