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

python - Does anyone know how to configure the hunpos wrapper class on nltk? -

mysql - How to insert just year and month into date field? -