I have using beautifulsoup to extract datas.
I hava such a html file:
<div class=a>
<a href='google.com'>a</a>
</div>
<div class=b>
<a href='google.com'>c</a>
<a href='google.com'>d</a>
</div>
I want to extract data ‘c,d’ in ,I don’t need data ‘a’ in
so I do:
google_list = soup.findAll('a',href='google.com')
for item in google_list:
print item.strings
it will print a,c,d.
so my problem is how to just print ‘c’,’d’ in without ‘a’ in
You could just select based upon the
divwhose class isband then after that use your original query on that tag so that you look for its children: