I'm attempting to write a python program to parse the following page and extract the card sub-brand and brand given the card bin#: https://www.cardbinlist.com/search.html?bin=371793. The following code snippet retrieves the card type.
page = requests.get('https://www.cardbinlist.com/search.html?bin=371793')
tree = html.fromstring(page.content)
print("card type: ", tree.xpath("//td//following::td[7]")[0].text)
However, not sure how to get the brand using similar logic as given
<th>Brand (Financial Service)</th>
<td><a href="/AMEX-bin-list.html" target="_blank">AMEX</a></td>
then
tree.xpath("//td//following::td[5]")[0].text
returns none.