Vnay0007
(Vnay)
November 2, 2021, 7:19am
1
Hi,
Am trying to download all the 3 types (grizzly,black,teddy) of Bear images into path
, using DuckDuckGo
.
And the code runs fine without any errors.
But when I try to confirm the same - it seems no images were downloaded.
Can anyone please guide where am going wrong!!
Truly appreciate the help!!
Thanx!
Not addressing the problem you are having but I found this post quite helpful if you are open to trying a different method for downloading the images - Alternative to bing image search
Vnay0007
(Vnay)
November 3, 2021, 1:51pm
3
Hey Bijil,
Thank you so much for the quick help.
Tried it out, along with many other suggestions posted in the forums.
And after many failed trials, one solution which worked was :
“To move the for
loop out of the if
condition” - which was suggested by @mrfabulous1
Hi Chikwado and jimmiemunyi hope all is well!
I was looking at the code and noticed there is a logical error.
because if you create the path first, before you run the code, the three instructions below
if not path.exists():
will not run.
if not path.exists():
path.mkdir()
api.competition_download_cli('bluebook-for-bulldozers', path=path)
file_extract(path/'bluebook-for-bulldozers.zip')
The code should probably be as above.
hope this helps.
Cheers mrfabulous1
Also, to my surprise , after doing so not only does the new code work fine, but the previous code (which I posted y’day) works fine too.
Makes me go crazy, as to what made it not work in the 1st place y’day!!
Anyways, thanx again mate!!
2 Likes
Vnay0007
(Vnay)
November 8, 2021, 1:41pm
4
E D I T (for any one facing similar issue in future) :
Please find below the final working code “To download Bear images from DuckDuckGo”
3 Likes
Fosman
(Addai Fosberg)
May 21, 2022, 2:08pm
5
Yes, this answer is great!
It works pretty well