'Is it possible to download an image file using the dryscape Python module?
I am trying to use dryscrape to scrape a web page, but is possible to save a particular image from page? It is a normal <img> tag.
Solution 1:[1]
From looking at the documentation at https://dryscrape.readthedocs.io/, it does not look like dryscrape supports downloading files. You will have to use a module such as Requests to do this.
Solution 2:[2]
Yes you can download image with Dryscrape like that
img_url = sess.xpath("//img")[0]['href']
sess.visit(img_url)
sess.render("image.png")
Try this
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Al Sweigart |
| Solution 2 | Haroon Amjad |
