image_search icon indicating copy to clipboard operation
image_search copied to clipboard

download 0 images?

Open twmht opened this issue 3 years ago • 2 comments

Issue Template

Please provide what type of issue this is (i.e. bug, suggestion, etc.), your stacktrace (if applicable), and steps taken to try to fix or avoid this bug/issue (if applicable).

I try to google cat with limit 10 images

tumh@tumh-Predator-G9-592:~/images$ PATH=$PATH:/home/tumh/images image_search google cat --limit 10 --json
/usr/local/lib/python2.7/dist-packages/pyOpenSSL-19.1.0-py2.7.egg/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography import x509

===============================================

[%] Successfully launched ChromeDriver
[%] Successfully opened link.
/usr/local/lib/python2.7/dist-packages/selenium-4.0.0a6.post2-py2.7.egg/selenium/webdriver/remote/webdriver.py:592: UserWarning: find_element_by_* commands are deprecated. Please use find_element() instead
  warnings.warn("find_element_by_* commands are deprecated. Please use find_element() instead")
[%] Scrolling down.
/usr/local/lib/python2.7/dist-packages/selenium-4.0.0a6.post2-py2.7.egg/selenium/webdriver/remote/webdriver.py:392: UserWarning: find_element_by_* commands are deprecated. Please use find_element() instead
  warnings.warn("find_element_by_* commands are deprecated. Please use find_element() instead")
[%] Reached end of Page.
[%] Closed ChromeDriver.
[%] Indexed 0 Possible Images.

===============================================

[%] Getting Image Information.


[%] Done. Downloaded 0 images.

===============================================

any idea?

twmht avatar Nov 10 '20 14:11 twmht

Google has changed their UI and this no longer works. I am looking for a solution to this myself. When using bing I am getting this:

Traceback (most recent call last):
  File "console.py", line 77, in <module>
    main()
  File "console.py", line 73, in main
    _bing.bing(metadata, query, limit, adult)
  File "/Users/xuser/Downloads/image_search-master/image_search/_bing.py", line 106, in bing
    for i in soup.find_all("a", class_="iusc")]
  File "/Users/xuser/Downloads/image_search-master/image_search/_bing.py", line 106, in <listcomp>
    for i in soup.find_all("a", class_="iusc")]
  File "/usr/local/Cellar/[email protected]/3.7.9_3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/[email protected]/3.7.9_3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/[email protected]/3.7.9_3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 348 (char 347)

Not being an experienced python coder I am a bit lost (I a beginner on the language).

frankhdz avatar Mar 06 '21 19:03 frankhdz

Hi all, I wrote this library when I was a Freshman in high school and didn't know much about Python (which explains some of the poor code structure in this repo). In order to fix a majority of the new issues, there will be need to a major restructure, which I plan to getting around to at some point. If anyone else is interested in working on this earlier, I would be happy to review PRs.

rushilsrivastava avatar Mar 07 '21 01:03 rushilsrivastava