Answers for "how to use beautiful soup to find all id's having a specific string"

0

how to use beautiful soup to find all id's having a specific string

>>> print soupHandler.findAll('div', id=re.compile('^post-'))
[<div id="post-45">...</div>, <div id="post-334">...</div>]
Posted by: Guest on March-02-2021
0

how to use beautiful soup to find all id's having a specific string

import re
[...]
soupHandler.findAll('div', id=re.compile("^post-\d+"))
Posted by: Guest on March-02-2021

Code answers related to "how to use beautiful soup to find all id's having a specific string"

Browse Popular Code Answers by Language