You can access tag’s attributes by treating the tag like a dictionary (documentation):
for tag in soup.find_all(class_="bookmark blurb group") :
print tag.get('id')
The reason tag.id
didn’t work is that it is equivalent to tag.find('id')
, which results into None
since there is no id
tag found (documentation).