0

I need to extract the text just after strong tag from html page given below? how can i do it using beautiful soup. It is causing me problem as it doesn't have any class or id so only way to select this tag is using text.

{strong}Name:{/strong} Sam smith{br}

Required result

Sam smith

Utsav Shukla
  • 47
  • 2
  • 8

1 Answers1

-1

Thanks for all your answers but i was able to do this by following:

b_el = soup.find('strong',text='Name:') print b_el.next_sibling

This works fine for me. This prints just next sibling how can i print next 2 sibling is there anyway ?

Utsav Shukla
  • 47
  • 2
  • 8