변구훈*_*변구훈 7 python web-crawler
我正在通过 Google 图片下载器抓取图片。原本可以运行的代码突然停止运行了,这个问题怎么解决?代码和错误信息如下
from google_images_download import google_images_download
def ImageCrawling(keyword, dir):
response = google_images_download.googleimagesdownload()
arguments = {"keywords":keyword
,"limit":2
,"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
ImageCrawling('dog','C:\\nuguya')
Run Code Online (Sandbox Code Playgroud)