python - Using BeautifulSoup to find all elements starting with a given letter -


if want find <p> elementswith id=test beautifulsoup, use :

for item in soup.findall('p', {"id": "test"}): 

how find every

element id starting specific letter - let's "t"?

i tried "t*" doesn't work.

try:

import re item in soup.findall('p', {"id": re.compile('^t')}): 

Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -