1

I'm using selenium python to download several images from a chat in whatsapp web.

code:

images = driver.find_elements_by_class_name('_22Mb1')
for image in images:
    sticker = image.get_attribute('src')
    url.urlretrieve(sticker)

but I get this error

urllib.error.URLError: <urlopen error unknown url type: blob>

How can I solve it? I'm also fine with different methods (possibly with selenium).

Ps:

I would also like to save the images in png format, is there a way to do that?

ToboBaldo
  • 15
  • 4
  • You might want to debug what the value of `src` is – Maurice Meyer May 25 '20 at 11:24
  • Does this answer your question? [How to download an image with Python 3/Selenium if the URL begins with "blob:"?](https://stackoverflow.com/questions/47424245/how-to-download-an-image-with-python-3-selenium-if-the-url-begins-with-blob) – olli_kahn May 25 '20 at 19:59
  • Ive already read that question and it seemed (to me ) that the answers were actually for javascrip (which I totally don't understand yet). Maybe I'm wrong and in this case I would be glad if you gave me some tips on how to understand them ;) – ToboBaldo May 26 '20 at 11:24

1 Answers1

1

You can try with python library url validator http://validators.readthedocs.org/en/latest/#

Try this solution: https://stackoverflow.com/a/32171869/4133110

bihari_gamer
  • 422
  • 5
  • 15