How to download a file without a browser using Sikuli

Asked by Vit on 2017-11-15

Hello!
How to download a file without a browser using Sikuli? For example how to get Google's logo (https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png) and save it under the name c:\photo\photo.png ?
Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
TestMechanic
Solved:
2017-11-15
Last query:
2017-11-15
Last reply:
2017-11-15
Manfred Hampl (m-hampl) said : #1

There are tools for doing this, e.g. wget available at http://www.gnu.org/software/wget/

Best TestMechanic (ndinev) said : #2

import urllib
urllib.urlretrieve("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png", "c:\\temp\\img.png")

Notes:
1. file location is in windows format - change if needed for mac/linux
2. In IDE you may have problem to run this twice - restart IDE if needed. I guess it will be fine when starting code as script

Vit (polet) said : #4

Thanks TestMechanic, that solved my question.