如何下载随机1000张图片 https:/images.google.com。 请帮帮我
from google_images_download import google_images_download
response = google_images_download.googleimagesdownload()
search_queries =
[
'The smartphone also features an in display fingerprint sensor.',
'The pop up selfie camera is placed aligning with the rear cameras.',
'''In terms of storage Vivo V15 Pro could offer
up to 6GB of RAM and 128GB of onboard storage.''',
'The smartphone could be fuelled by a 3 700mAh battery.',
]
def downloadimages(query):
arguments = {"keywords": query,
"format": "jpg",
"limit":4,
"print_urls":True,
"size": "medium",
"aspect_ratio":"panoramic"}
try:
response.download(arguments)
except FileNotFoundError:
arguments = {"keywords": query,
"format": "jpg",
"limit":4,
"print_urls":True,
"size": "medium"}
try:
response.download(arguments)
except:
pass
for query in search_queries:
downloadimages(query)
print()
你可以使用google_images_download模块。