Answer the question
In order to leave comments, you need to log in
How to separate same python bs4 classes?
I need to separate the information (text) and put it in the lists, but alas, it is under the same classes and the standard findAll methods cannot be divided.
.
How can I do that?
Answer the question
In order to leave comments, you need to log in
import requests
from bs4 import BeautifulSoup
response = requests.get('https://www.roseltorg.ru/procedure/0114500000820000578')
soup = BeautifulSoup(response.text,"html.parser")
table = soup.find_all('table',class_='lot-item__data-table')[1]
info_ = table.find_all('p',class_='data-table__info')
inn = info_[0].text
name = info_[1].text
address = info_[2].text
phone = info_[3].text
mail = info_[4].text
place = info_[5].text
print(f'''ИНН: {inn}
Название орг: {name}
Адрес: {address}
Телефон: {phone}
E-mail: {mail}
Место проведения: {place}
''')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question