Image-Downloader icon indicating copy to clipboard operation
Image-Downloader copied to clipboard

hi~我是一个正在学习ai的学生,使用您的爬虫爬取baidu图片,特此求助:使用gui方式打开,选取baidu,搜索关键字,点击start,然后就会报错如下

Open healthybaobao opened this issue 3 years ago • 8 comments

[10:07:57] -e Baidu -d chrome_headless -n 100 -j 50 -o "E:/zb/code/images/mouse" -S "mouse" [10:07:57] Scraping From Baidu Image Search ... [10:07:57] Keywords: mouse [10:07:57] Number: 100 [10:07:57] Face Only: False [10:07:57] Safe Mode: True [10:07:57] Query URL: https://image.baidu.com/search/index?tn=baiduimage&word=mouse [10:07:57] Exception in thread [10:07:57] Thread-3 [10:07:57] : [10:07:57] Traceback (most recent call last): [10:07:57] File "D:\软件\python64\lib\threading.py", line 954, in _bootstrap_inner [10:07:57] self.run() [10:07:57] File "D:\软件\python64\lib\threading.py", line 892, in run [10:07:57] self._target(*self._args, **self.kwargs) [10:07:57] File "E:\zb\code\Image-Downloader\image_downloader.py", line 50, in main [10:07:57] crawled_urls = crawler.crawl_image_urls(args.keywords, [10:07:57] File "E:\zb\code\Image-Downloader\crawler.py", line 325, in crawl_image_urls [10:07:57] image_urls = baidu_get_image_url_using_api(keywords, max_number=max_number, face_only=face_only, [10:07:57] File "E:\zb\code\Image-Downloader\crawler.py", line 206, in baidu_get_image_url_using_api [10:07:57] init_json = json.loads(res.text.replace(r"'", ""), encoding='utf-8', strict=False) [10:07:57] File "D:\软件\python64\lib\json_init.py", line 359, in loads [10:07:57] return cls(**kw).decode(s) [10:07:57] TypeError [10:07:57] : [10:07:57] init() got an unexpected keyword argument 'encoding' [10:07:57] stopped

healthybaobao avatar Mar 12 '21 02:03 healthybaobao

https://www.pianshen.com/article/59561646121/ 试一试能否有用

Ans0nXD avatar Apr 28 '21 18:04 Ans0nXD

change init_json = json.loads(res.text.replace(r"'", ""), encoding='utf-8', strict=False) to init_json = json.loads(res.text.replace(r"'", ""))

zsr228 avatar Jun 02 '21 10:06 zsr228

改了之后,还是不行啊

Lininggggggg avatar Dec 13 '21 03:12 Lininggggggg

找到问题了,要改两处 image

Lininggggggg avatar Dec 13 '21 04:12 Lininggggggg

找到问题了,要改两处image

您好,能帮我看一下是什么问题吗

zszaxlywn avatar May 01 '22 14:05 zszaxlywn

ty!

Zhangbole1 avatar Dec 18 '22 11:12 Zhangbole1

ty!

Zhangbole1 avatar Dec 18 '22 11:12 Zhangbole1

ok,thank

Oneboy77 avatar Jan 03 '23 02:01 Oneboy77