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

TypeError: 'NoneType' object is not subscriptable #1

Open
Arpit980jai opened this issue May 3, 2023 · 1 comment
Open

TypeError: 'NoneType' object is not subscriptable #1

Arpit980jai opened this issue May 3, 2023 · 1 comment

Comments

@Arpit980jai
Copy link

Arpit980jai commented May 3, 2023

@commonkestrel
Hello Please Help me with this,
I have created a blank project and imported the GoogleImageScraper
and copied the below test code

raceback (most recent call last):
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper\GoogleImageScraper.py", line 42, in urls
imageObjects = self.get_images(searchData)
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper\GoogleImageScraper.py", line 207, in get_images
imageObjects = pageJson[31][0][12][2]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper\GoogleImageScraper.py", line 47, in urls
imageObjects = self.get_images(searchData)
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper\GoogleImageScraper.py", line 207, in get_images
imageObjects = pageJson[31][0][12][2]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\acer\PycharmProjects\pythonProject3\main.py", line 5, in
images = GoogleImageScraper.download(query='dogs', limit=1, arguments={'color':'brown', 'download_format': 'png'})
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper_init_.py", line 14, in download
returnImages = scraper.download(query=query, limit=limit, arguments=arguments)
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper\GoogleImageScraper.py", line 62, in download
urls = self.urls(query, arguments=arguments)
File "C:\Users\acer\pythonProject3\lib\site-packages\GoogleImageScraper\GoogleImageScraper.py", line 49, in urls
raise UnpackError('Failed to fetch image objects.')
GoogleImageScraper.errors.UnpackError: Failed to fetch image objects.

Process finished with exit code 1

image

Please take a look at it

@Arpit980jai
Copy link
Author

STILL wAITING FOR your response

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

1 participant