почему парится только один запрос?

import requests
from bs4 import BeautifulSoup
import json

URL = 'https://miped.ru/'
HEDERS = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
}
req = requests.get(URL, headers=HEDERS)

src = req.text

# with open('index.html', 'w', encoding="utf-8") as file:
#     file.write(src)

soup = BeautifulSoup(src, 'lxml')

all_content = {}
all_content1 = []
content = soup.find_all('div', class_="news-items")

#------------------------ВОТ ТУТ------------------------------------------
for item in content:
    name = item.find('a', class_="news-item-header__title").next.text
    link = item.find('a', class_="news-item-header__title").get('href')
    all_content[name] = link
#------------------------------------------------------------------------
with open('pars_EpicG.json', 'w', encoding='utf-8') as file:
    json.dump(all_content, file , indent=4, ensure_ascii=False)


При парсинге сайта https://miped.ru/ задачей было просто вытащить название статьи и ссылку но почему то вытаскивает только одно название и одну ссылку соответственно первую


Ответы (1 шт):

Автор решения: n1tr0xs

Ваша проблема в том, что вы перепутали class блока div.
Вы указали news-items, а нужно news-item.

→ Ссылка