From c8ef30bfb8660a79115cf0132fc09fbba5091f6e Mon Sep 17 00:00:00 2001 From: Mayank Gupta <67818466+Mayank-Creater@users.noreply.github.com> Date: Wed, 2 Oct 2024 00:40:59 +0530 Subject: [PATCH] Update crawl_hindustan_times_and_get_top_news.py --- web_programming/crawl_hindustan_times_and_get_top_news.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web_programming/crawl_hindustan_times_and_get_top_news.py b/web_programming/crawl_hindustan_times_and_get_top_news.py index 0234b39b9..d2f8de070 100644 --- a/web_programming/crawl_hindustan_times_and_get_top_news.py +++ b/web_programming/crawl_hindustan_times_and_get_top_news.py @@ -18,11 +18,13 @@ from bs4 import BeautifulSoup def fetch_ht_news() -> dict: + header = { "Accept": "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8", "Sec-GPC": "1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36" - "", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)\ + AppleWebKit/537.36 (KHTML, like Gecko)\ + Chrome/127.0.0.0 Safari/537.36", "sec-ch-ua": '"Not)A;Brand";v="99", "Brave";v="127", "Chromium";v="127"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "Windows",