0

Учусь модулю BeautifulSoup, вывожу текст из кода сайта, а он выводит два, в чём проблема?

код:

import requests
from bs4 import BeautifulSoup

url = 'https://store.steampowered.com/app/262060/Darkest_Dungeon/'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
quotes = soup.find_all('div', class_='apphub_AppName')

for quote in quotes:
    print(quote.text)

1 ответ 1

2

Страница содержит 2 элемента с классом apphub_AppName.

В итоге у вас в переменной quotes 2 объекта, ну и далее вы выводите их в цикле

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.