Comments (13)
I will update this source code to do this automatically
from google-image-scraper.
FYI:
The method mentioned above didn't work for me, as the screen went from a "Accept all" popup into a whole "Accept all" screen. I thus had to add
def find_image_urls(self):
"""
This function search and return a list of image urls based on the search key.
Example:
google_image_scraper = GoogleImageScraper("webdriver_path","image_path","search_key",number_of_photos)
image_urls = google_image_scraper.find_image_urls()
"""
print("[INFO] Gathering image links")
self.driver.get(self.url)
...
accept_all_button_xpath = '//*[@id="yDmH0d"]/c-wiz/div/div/div/div[2]/div[1]/div[3]/div[1]/div[1]/form[2]/div/div/button'
self.driver.find_element_by_xpath(accept_all_button_xpath).click()
I hope this helps somebody!
from google-image-scraper.
Ah, I just realize it downloads the images after all the links are obtained.
from google-image-scraper.
Ah, I just realize it downloads the images after all the links are obtained.
You got it, what license agreement popup are you referring to? Is this something that's an issue or did you find a solution?
from google-image-scraper.
Like when you use Chrome in Incognito mode, and google something, you get a pop-up asking to agree to google's terms. The only way I managed to bypass it is by running the script with headless = false and decline the agreement manually. But then I can't use my pc while the script is running. It stops when I minimise the browser.
from google-image-scraper.
Like when you use Chrome in Incognito mode, and google something, you get a pop-up asking to agree to google's terms. The only way I managed to bypass it is by running the script with headless = false and decline the agreement manually. But then I can't use my pc while the script is running. It stops when I minimise the browser.
I've never seen that popup before, could be a region issue. What country are you in?
from google-image-scraper.
The Netherlands
from google-image-scraper.
I suspect it may be a regional issue. I'm unable to replicate this issue.
from google-image-scraper.
I think you might be able to load your chrome profile into selenium to resolve this issue
from google-image-scraper.
Hi,
In the function GoogleImageScraper after the line
driver.get("https://www.google.com")
you can add:
driver.find_element(By.ID, "L2AGLb").click()
That should bypass the chrome popup by clicking on the Accept all button.
I will push that fix if you confirm that it works for you.
from google-image-scraper.
@mooujarrar It works :)
from google-image-scraper.
The popup usually occurs while trying to search flagged or age-restricted content; hence, Google asks for the agreement.
Good thing @mooujarrar solved it.
from google-image-scraper.
Hi,
In the function GoogleImageScraper after the line
driver.get("https://www.google.com")
you can add:driver.find_element(By.ID, "L2AGLb").click()
That should bypass the chrome popup by clicking on the Accept all button. I will push that fix if you confirm that it works for you.
@mooujarrar, Works for me too, thanks.
from google-image-scraper.
Related Issues (20)
- stuck on consent page HOT 7
- can we save images with Default image name insted of Numbers? HOT 2
- chrome closing HOT 1
- Does not work on Linux HOT 1
- Unable to get link HOT 5
- 2 things HOT 5
- Program loops indefinitely while trying to install chrome driver HOT 4
- Use it with local files HOT 1
- [macOS] chromedriver can't launch - "unable to download lastest chromedriver. the system will use the local version instead" HOT 4
- Looks like image URL extraction stopped working, coz of Google update. Anyone has an update? HOT 2
- Download from a specific link HOT 1
- Not working and no error message HOT 12
- Please accept depentabot PR to bump pillow version to 9.3
- class names changed? HOT 12
- Starting the scraper from a given point.
- Filter by licence
- Not working in the Linux HOT 2
- Issue when running the code HOT 2
- Webdriver folder missing in master
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-image-scraper.