0
>>> type(col)
<class 'bs4.element.Tag'>
>>> col
<td><a href="/english/js/au/">Detail</a></td>

Could someone help me to cleanly extract in python href as a string from the above data? I wan to get the path "/english/js/au/" as string.

Amiclone
  • 388
  • 2
  • 11

1 Answers1

1

This should help you:

href = col.find('a')['href']

print(href)

Output:

/english/js/au/
Sushil
  • 5,440
  • 1
  • 8
  • 26