如何使用硒/python 从特定图像中获取 url?
how can i get the url from a specific image with selenium / python?
我正在尝试从 whatsapp 网站下载一些图片。我找到了一种识别图像的方法,但不知道如何获取它们的 URL.
部分代码:
images = driver.find_elements_by_tag_name('img')
for image in images:
sticker = # <idk how to get the URL>
url.urlretrieve(sticker)
顺便说一句,如果有最好的下载方式,我会很高兴听到一些建议。
src
属性保存该信息。
images = driver.find_elements_by_tag_name('img')
for image in images:
sticker=image.get_attribute('src')
url.urlretrieve(sticker)
我正在尝试从 whatsapp 网站下载一些图片。我找到了一种识别图像的方法,但不知道如何获取它们的 URL.
部分代码:
images = driver.find_elements_by_tag_name('img')
for image in images:
sticker = # <idk how to get the URL>
url.urlretrieve(sticker)
顺便说一句,如果有最好的下载方式,我会很高兴听到一些建议。
src
属性保存该信息。
images = driver.find_elements_by_tag_name('img')
for image in images:
sticker=image.get_attribute('src')
url.urlretrieve(sticker)