Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Install beautifulsoup4 and request .
import requests
from bs4 import BeautifulSoup
html = requests.get(url).text
soup = BeautifulSoup(html, 'html.parser')
find_text = soup.find('div', {'id': 'название нужного id'}).get_text()
from lxml import html
tree = html.fromstring('<содержимое какой-то страницы>')
tree.xpath('.//div[@id="<какой-то определенный id>"]')[0].text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question