How to save image "through" Selenium using Python and PhantomJS Webdriver?

I want to upload images “through” the same session that my PhantomJS instance created. This means that I cannot just get the srcimage attribute and load it using urllib or queries or equivalents.

How to make one of

(1) open a new tab in a PhantomJS session and go to the image, saving the file to disk? (2) Right-click on the image that was loaded into the original page request and saved to disk? (3) Any other method that “copies” from the current PhantomJS session to load the image?

+4
source share

Source: https://habr.com/ru/post/1533602/


All Articles