Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key error: 'listnum' #38

Open
Ivan-Fan opened this issue Apr 15, 2021 · 2 comments
Open

Key error: 'listnum' #38

Ivan-Fan opened this issue Apr 15, 2021 · 2 comments

Comments

@Ivan-Fan
Copy link

Really thanks for your great work! However, recently I have met a strange problem like the following.
Any suggestions would help!

Keywords: 杨凡小时候
Number: 100
Face Only: False
Safe Mode: True
Query URL: https://image.baidu.com/search/index?tn=baiduimage&word=%E6%9D%A8%E5%87%A1%E5%B0%8F%E6%97%B6%E5%80%99
Traceback (most recent call last):
File "Myimage_downloader.py", line 143, in
main(sys.argv[1:])
File "Myimage_downloader.py", line 76, in main
browser=args.driver)
File "Image-Downloader-master\crawler.py", line 326, in crawl_image_urls
proxy=proxy, proxy_type=proxy_type)
File "Image-Downloader-master\crawler.py", line 207, in baidu_get_image_url_using_api
total_num = init_json['listNum']
KeyError: 'listNum'

@Sander-houqi
Copy link

same error...
http log:
{"antiFlag":1,"message":"Forbid spider access","bfe_log_id":"9576621861689003963"}

@Sander-houqi
Copy link

emmm..... , I have a tmp solution, change get url way from baidu_get_image_url_using_api to baidu_image_url_from_webpage in image_downloader.py function crawl_image_urls, it can download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants