'Wikipedia scrapping problem, how I can get content all tags inside one

I got a problem while trying to scrap wikipedia page. I want to get definition of title, but inside the tag I'm interested in there are many other tags, and I don't understand how I can obtain content all these tags.

May be exist more simple way to scrape definition, but I don't know how.

def connect(subject: str):
    subject = subject.replace(' ', '_')
    responce = requests.get(f'https://ru.wikipedia.org/wiki/{subject}')
    if responce.status_code == 404:
        print('404 not found')

    with open('Scrab/test.html', 'w+', encoding='utf-8') as f:
        f.write(responce.text)

    tree = html.fromstring(responce.text)
    definition = tree.xpath('//div[@class="mw-parser-output"]/p')
    print(definition[0].text)

This is way how I tryed get content tag <p>



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source