This repo is for crawling full size image in the google search.
- WEB : Chrome Version 106.0.5249.91 (Official Build) (x86_64)
- OS : MAC
- IDE : Pycharm
selenium == 4.4.3
-
Download suitable chrome driver.
Follow this link.
-
You should specify PATH in
webdriver.Chrome()
PATH="./chromedriver" driver = webdriver.Chrome(executable_path=PATH)
-
You should specify full size image xpath in chorme.
-
replace copied xpath with copied variable.
copied_xpath='//*[@id="Sva75c"]/div/div/div[3]/div[2]/c-wiz/div/div[1]/div[1]/div[3]/div/a/img'
-
Run the code!.
Follow command like this.
python main.py Please enter a search term: jordon white white Enter the total number: 50
Please enter a search term: pikachu
Enter the total number: 5
**************************************************Crawlling started.**************************************************
Image saved: pikachu_1.jpg
Image saved: pikachu_2.jpg
Image saved: pikachu_3.jpg
Image saved: pikachu_4.jpg
Image saved: pikachu_5.jpg
**************************************************Crawlling Completed.**************************************************
- I'm not sure but copied xpath can be reused for different search term.
- I guess that when chrome is updated or google updated their search engine, we should copy again.