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&nbsp;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]) 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo