KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Beautiful soup documentation provides attributes .contents and .children to access the children of a given tag (a list and an iterable respectively), and includes both Navigable Strings and Tags. I want only the children of type Tag. I'm currently accomplishing this using list comprehension: rows=[x for x in table.tbody.children if type(x)==bs4.element.Tag] but I'm wondering if there is a better/more pythonic/built-in way to get just Tag children.
Tags (comma-separated)
Save Edits
Cancel