is he still having trouble, you could use the find_next
method in BeautifulSoup to find the next "div" tag with class "body" after the "font" tag with class "runner"
from bs4 import BeautifulSoup html = """ <div> <font class="name">John</font> <div class="body">Not me</div> <font class="runner">Letters to</font> <div class="body">Find me!</div> </div> """ soup = BeautifulSoup(html, 'html.parser') # Find the font tag with class "runner" runner = soup.find('font', class_='runner') # Find the next div tag with class "body" after the font tag with class "runner" body = runner.find_next('div', class_='body') print(body.text)
This should output