google_images_download
파이썬은 다양한 라이브러리를 통해 웹 페이지에 넘쳐나는 이미지들을 크롤링 수행할 수 있도록 도와줍니다.
google_images_download 예제입니다.
# 참고: https://google-images-download.readthedocs.io/en/latest/examples.html
# pip install google_images_download
from google_images_download import google_images_download
def ImageCrawling(keyword, dir):
response = google_images_download.googleimagesdownload()
arguments = {"keywords":keyword # 키워드
,"limit":50 # 이미지 크롤링 수
,"print_urls":True # 출력 여부
,'output_directory':dir} #이미지 저장 장소
paths = response.download(arguments) #passing the arguments to the function
print(paths) #printing absolute paths of the downloaded images
# 여러 검색어 검색:'Polar bears,baloons,Beaches' 꼼마로 구분 된다. 각각 폴더로 생성
ImageCrawling('오재원','d:/lg/')
'프로그래밍언어 > Python' 카테고리의 다른 글
[케라스] Keras 숫자 인식 샘플 (0) | 2019.12.16 |
---|---|
[케라스] Keras 개요 및 개념 잡기 (0) | 2019.12.13 |
파이참 키맵 비주얼 스튜디오 형태로 변경 (0) | 2019.10.29 |
파이참 - IntelliJ IDEA vim 제거 (0) | 2019.08.01 |
python console(콘솔) 숨기기 (0) | 2019.02.26 |
댓글