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

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

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