I have managed to get only the h2 and h3 tags printed out.. But I want every element from first h2 to the second h2 tag(data in those tags is only related to english).Like in this picture Then, I would like to check that data for categories like noun, verb and if they exist - print them out. Got stuck really hard here. This is what I've written so far
url = 'https://en.wiktionary.org/wiki/dog'
r = requests.get(url,headers={'User-agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64)'})
data = r.text
soup = BeautifulSoup(data)
content = soup.find_all('span',{'class':'mw-headline'})
for item in content:
print item.text