From 2c3f6fdb1775f6fd647bc563ed1f2ac17712aafe Mon Sep 17 00:00:00 2001 From: serser <3620404+serser@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:11:12 +0800 Subject: [PATCH] bugfix: KeyError:'data' when using BaiduImageCrawler see https://github.com/hellock/icrawler/issues/103#issuecomment-1476074321 --- icrawler/crawler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/icrawler/crawler.py b/icrawler/crawler.py index ce53a0e..1791c7e 100644 --- a/icrawler/crawler.py +++ b/icrawler/crawler.py @@ -134,6 +134,7 @@ def set_session(self, headers=None): """ if headers is None: headers = { + "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2", "User-Agent": ( "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" " AppleWebKit/537.36 (KHTML, like Gecko) "