0
votes

I'm having trouble to extract specific set of words in a webelement and assigning it to a list. My webelement.

My webelement.text looks like:

Accountant Johnathan Christensen <br>
President<br>
Accountant Annete Benning<br>
Vice President

And I need it to be inserted in a list, that should looks like:

list[['Johnathan Christensen','President']
     ['Annete Bening', 'Vice-President']]**

I'm getting an empty result using this code within a loop:

list.append(re.findall(r"^vice-president (.*)",col.text))

How can I make it work?