Find the dt tag in the text and find the next dd sibling :
soup.find('div', class_='detail_date').find('dt', text='Date').find_next_sibling('dd').text
Full code:
from bs4 import BeautifulSoup data = """ <div class='dl_item_container clearfix detail_date'> <dt>Date</dt> <dd> 2008 </dd> </div> """ soup = BeautifulSoup(data) date_field = soup.find('div', class_='detail_date').find('dt', text='Date') print date_field.find_next_sibling('dd').text.strip()
Print 2008 .
source share