selenium download image
Python hosting: Host, run, and code Python in the cloud!
Selenium,a web automation framework, can be used to get the all of the image links from a webpage.In this article we’ll given an example of that.
Related course
Browser Automation with Python Selenium
Get image links
At first we import the selenium module and start the web driver object.
|
The webpage consists of html code, defined by tags. To show an image a webpage has a code:
|
Then we find all the elements using the img tag (from html):
|
Finally we print the link of each image using:
|
Full code:
|
That will return all the image urls on the webpage.
To download import urllib and use the line:
|
You could also use wget, by using os.system();
Posted in selenium
Leave a Reply: