atif93 / google_image_downloader Goto Github PK
View Code? Open in Web Editor NEWDownloading any number of images for a search query
Downloading any number of images for a search query
The current script uses urllib2, which is outdated and not supported by Python3. Further, instructions to install dependencies such as Geckodriver are not given. An alternate script for Python3 users will be very useful.
At present, the web scraping scripts are separated for each Python version.
There is a need to create a single script, by examining points of difference between the two versions. This would mean exploring urllib2 and urllib for Python2 and Python3 respectively, and understanding each of the Python scripts currently implemented.
Further, appropriate changes to the documentation are needed once the above has been completed.
Hey,
While running your code, I face the following error
File "image_download.py", line 73, in <module> main() File "image_download.py", line 23, in main driver = webdriver.Firefox() File "/home/praveer/anaconda2/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 144, in __init__ self.service.start() File "/home/praveer/anaconda2/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "/home/praveer/anaconda2/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/home/praveer/anaconda2/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 8] Exec format error
Am I missing something here ?
Hi found this from the stackoverflow post.
And when I tried to run it It gave me this error.
Traceback (most recent call last):
File "image_download.py", line 73, in <module>
main()
File "image_download.py", line 15, in main
num_requested = int(sys.argv[2])
IndexError: list index out of range
Is it broken or I'm I missing something?
I tried running your code with Firefox settings, it gave me connection errors and problems so I changed webdriver to use Safari. It opens the session looks through the images I want and then exits without downloading any of them. The command i use is:
python3 image_download_python3.py 'cat' 20
The output I get is:
Total images: 0
Total downloaded: 0/0
Can you please aid me to solve the problem? Thanks.
After running with python2 I am getting this error
File "image_download_python2.py", line 73, in
main()
File "image_download_python2.py", line 23, in main
driver = webdriver.Firefox()
File "/home/raushan/.virtualenvs/cv/local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in init
self.service.start()
File "/home/raushan/.virtualenvs/cv/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 394, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
I want to download 1100 images for a query but it allows me only 300 with the error "Less images found: Message: Element could not be scrolled into view". I think code has the issue at some point like the nested loop has something to play
for _ in range(int(number_of_scrolls)):
for __ in range(10):
for the second loop value when i increase it to 120 it allows me 913 images . I am little confuse about this loop. Can you please explain what are you doing in here ? looking forward to you !
one more thing that the show more result is also not showing at the end of the page you can see in the screen shot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.