Answer the question
In order to leave comments, you need to log in
BeautifulSoup: how to find element by attribute only without specifying tag name?
For example, a page might have one of the article title options:
<h1 itemprop="headline">Текст</h1>
<h3 itemprop="headline">Текст</h3>
<p itemprop="headline">Текст</p>
soup.select_one('*',{'itemprop' : 'headline'}).text
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question