인스타그램으로 크롤링 하기 이외에도 구글 이미지를 크롤링 할 수 있다.
개인적으로 해시태그를 통해서 크롤링 하는 방법은 네거티브 이미지가 너무 많이 포함되어있기 때문에 비추,
구글 이미지는 자신이 원하는 검색어의 조합을 통해 크롤링 하기 때문에
마음에 드는 이미지가 다수 포함될 수 있다는 장점이 있다.
하지만 한번에 100개 까지 밖에 수집이 안되는 듯 하다.
1. 설치하기
https://google-images-download.readthedocs.io/en/latest/installation.html
$ pip install google_images_download
$ git clone https://github.com/hardikvasa/google-images-download.git
$ cd google-images-download && sudo python setup.py install
2. 사용하기
$ googleimagesdownload -k "쓰러진 사람" -o "lying" -l 100
이는 쓰러진 사람 이라는 키워드를 통해 lying 폴더에 100개의 이미지를 저장하겠다는 의미이다.
/home/google-images-download/lying/쓰러진 사람 이라는 폴더가 생성되고, 그 내부에 이미지가 저장된다.
다양한 명령어는 아래를 참고
https://google-images-download.readthedocs.io/en/latest/examples.html#
Examples — Google Images Download documentation
Examples Link to GitHub repo Link to Documentation Homepage Link to Input arguments or parameters Config File Format You can either pass the arguments directly from the command as in the examples below or you can pass it through a config file. Below is a s
google-images-download.readthedocs.io
참고자료 :
https://github.com/hardikvasa/google-images-download
hardikvasa/google-images-download
Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code! - hardikvasa/google-images-download
github.com
'Programming > Python' 카테고리의 다른 글
[Python] 필요 패키지 목록 requirements.txt 만들고, 설치하기 (0) | 2019.12.30 |
---|---|
[Python] Python -m 의 의미 (0) | 2019.08.04 |
[Python] 인스타그램으로 크롤링하기 (2) | 2019.08.02 |
[Python] Python 심볼릭 링크 설정 (0) | 2019.04.18 |
[Python] 모듈 가져오기 (0) | 2019.04.06 |