jquery - beautifulsoup select parent content not children content -
i have following html:
<div class="date_on_by"> <a sasource="qp_focused" href="/author/bill-maurer/articles">bill maurer</a> <span class="bullet">•</span> yesterday, 9:33 <span class="bullet">•</span> <span class="comments">98 comments</span> </div>
if use text.find_all('div',class_="date_on_by").gettext() , returns "
bill maurer • yesterday, 9:33 • 98 comments
but want only:
yesterday, 9:33
which not in children content. how that?
i figured out !
for date in text.find_all('div',class_="date_on_by"): dates.append(re.split(text.find_all('span',class_="bullet")[0].gettext(),date.gettext())[1])