Home > OS >  Unusual indexing issue with selenium text selecting
Unusual indexing issue with selenium text selecting

Time:11-15

Iam selenium to practice web scraping and extract the names Twitter @'s for the top 100 universities in the UK using this site enter image description here

You can see that there's no <td> and <strong> in this element, so card2.find_elements_by_xpath("./td[1]/strong")[0].text will show the error.

The first <tr> with class even is the 3rd element of elementsEven, so we can get it by elementsEven[2].

  • Related