How to download a file without a browser using Sikuli

Asked by Vit

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:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
TestMechanic
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

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

Revision history for this message
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

Revision history for this message
Vit (polet) said :
#4

Thanks TestMechanic, that solved my question.