save an image with selenium & firefox

后端 未结 5 2002
灰色年华
灰色年华 2021-02-08 19:58

i\'m trying to save an image from a website using selenium server & python client. i know the image\'s URL, but i can\'t find the code to save it, either when it\'s the the

5条回答
  •  野的像风
    2021-02-08 20:37

    I haven't used selenium, but if you know the image's URL, why not just do:

    from urllib import urlretrieve
    
    urlretrieve(url, filename)
    

    which will save the url to the filename. more info here

提交回复
热议问题