Hi all,
Can someone come up with another solution to download the PNG generated by this URL?
https://www.google.com/maps/vt/data=9KZ ... =200&w=652
Seems it's dynamically generated, so URLDownloadtoFile doesn't seem to be working.
The only solution I came up with would be to pop open the browser, let it render then send CTRL S... but I'd love to do it in the background.
Any thoughts???
URL Download to File not working
- flyingDman
- Posts: 2848
- Joined: 29 Sep 2013, 19:01
Re: URL Download to File not working
It works fine here:
Code: Select all
url := "https://www.google.com/maps/vt/data=9KZnDfCpPlvTU8liZSxRK68iPgkpi9GbpD2FYCu5E0ZDk38075U0gI7qkeyXnksU1tgsFuLu3sa0b2uT_d87J6zH8Jque0tCB2Zz3m2g5ECC1R6oXlB65pD6zoerLOEc_wa_V-gCPfFgLBsF54iPUz0S6hDMh8FhON_qdm-l,9QY-qAGDoGYenT4VpxyK99_2EdBJhiV33wqM88e8G-rUb3PjERXM1G1kXsPSZajXT9rdIsiDrL2uCFU0gtEvyDmU7oBKMNYc26wVv4hrJiHC7AiLniIL0HW8Jnh7IuOGza0hrrefT6GLccqwz-XoIcOA6JAFn3FwYRo9AWFxDtOHliX1Zfb12utHjjhDcuRYTkd3DwvbVxZ0gCdDtjBHogrJ9QtpP-A9na3zlGEmQ75J7emq2G1x-qye7ejGizzQzu_xWWAPb9fwj7MYISmU4X7pJebod3gk1nZWrr4yC_pppb0tFsf36Qp-_-IaxgpoSnbbu1qgxSg?scale=1&h=200&w=652"
urldownloadtofile,%url%,map.png
run, map.png
14.3 & 1.3.7
-
- Posts: 13
- Joined: 11 Aug 2022, 18:50
Re: URL Download to File not working
Yes it does. Thanks.
I wonder why passing it in as a var makes a difference over this:
I wonder why passing it in as a var makes a difference over this:
Code: Select all
UrlDownloadToFile, "https://www.google.com/maps/vt/data=9KZnDfCpPlvTU8liZSxRK68iPgkpi9GbpD2FYCu5E0ZDk38075U0gI7qkeyXnksU1tgsFuLu3sa0b2uT_d87J6zH8Jque0tCB2Zz3m2g5ECC1R6oXlB65pD6zoerLOEc_wa_V-gCPfFgLBsF54iPUz0S6hDMh8FhON_qdm-l,9QY-qAGDoGYenT4VpxyK99_2EdBJhiV33wqM88e8G-rUb3PjERXM1G1kXsPSZajXT9rdIsiDrL2uCFU0gtEvyDmU7oBKMNYc26wVv4hrJiHC7AiLniIL0HW8Jnh7IuOGza0hrrefT6GLccqwz-XoIcOA6JAFn3FwYRo9AWFxDtOHliX1Zfb12utHjjhDcuRYTkd3DwvbVxZ0gCdDtjBHogrJ9QtpP-A9na3zlGEmQ75J7emq2G1x-qye7ejGizzQzu_xWWAPb9fwj7MYISmU4X7pJebod3gk1nZWrr4yC_pppb0tFsf36Qp-_-IaxgpoSnbbu1qgxSg?scale=1&h=200&w=652", LAX.png
-
- Posts: 13
- Joined: 11 Aug 2022, 18:50
Re: URL Download to File not working
and yes... I've tried it without the quotes as well...
Stumped.
Thanks for helping me through it.
Code: Select all
UrlDownloadToFile, https://www.google.com/maps/vt/data=9KZnDfCpPlvTU8liZSxRK68iPgkpi9GbpD2FYCu5E0ZDk38075U0gI7qkeyXnksU1tgsFuLu3sa0b2uT_d87J6zH8Jque0tCB2Zz3m2g5ECC1R6oXlB65pD6zoerLOEc_wa_V-gCPfFgLBsF54iPUz0S6hDMh8FhON_qdm-l,9QY-qAGDoGYenT4VpxyK99_2EdBJhiV33wqM88e8G-rUb3PjERXM1G1kXsPSZajXT9rdIsiDrL2uCFU0gtEvyDmU7oBKMNYc26wVv4hrJiHC7AiLniIL0HW8Jnh7IuOGza0hrrefT6GLccqwz-XoIcOA6JAFn3FwYRo9AWFxDtOHliX1Zfb12utHjjhDcuRYTkd3DwvbVxZ0gCdDtjBHogrJ9QtpP-A9na3zlGEmQ75J7emq2G1x-qye7ejGizzQzu_xWWAPb9fwj7MYISmU4X7pJebod3gk1nZWrr4yC_pppb0tFsf36Qp-_-IaxgpoSnbbu1qgxSg?scale=1&h=200&w=652, LAX10.png
Thanks for helping me through it.
Re: URL Download to File not working
You have syntax issues in both cases. In the first case, you have a quoted string as if it were an expression, but that parameter doesn’t take expressions unless you force an expression:
In the second case where you don’t have quotes around it and would otherwise be correct legacy syntax, the string contains a comma, so it must be escaped or else it sees what follows it as belonging to the next parameter:
If you switch to AHK v2, you can avoid all the expression vs. legacy syntax confusion because expressions are used throughout.
Code: Select all
UrlDownloadToFile, % "https://www.google.com/maps/vt/data=9KZnDfCpPlvTU8liZSxRK68iPgkpi9GbpD2FYCu5E0ZDk38075U0gI7qkeyXnksU1tgsFuLu3sa0b2uT_d87J6zH8Jque0tCB2Zz3m2g5ECC1R6oXlB65pD6zoerLOEc_wa_V-gCPfFgLBsF54iPUz0S6hDMh8FhON_qdm-l,9QY-qAGDoGYenT4VpxyK99_2EdBJhiV33wqM88e8G-rUb3PjERXM1G1kXsPSZajXT9rdIsiDrL2uCFU0gtEvyDmU7oBKMNYc26wVv4hrJiHC7AiLniIL0HW8Jnh7IuOGza0hrrefT6GLccqwz-XoIcOA6JAFn3FwYRo9AWFxDtOHliX1Zfb12utHjjhDcuRYTkd3DwvbVxZ0gCdDtjBHogrJ9QtpP-A9na3zlGEmQ75J7emq2G1x-qye7ejGizzQzu_xWWAPb9fwj7MYISmU4X7pJebod3gk1nZWrr4yC_pppb0tFsf36Qp-_-IaxgpoSnbbu1qgxSg?scale=1&h=200&w=652", LAX.png
In the second case where you don’t have quotes around it and would otherwise be correct legacy syntax, the string contains a comma, so it must be escaped or else it sees what follows it as belonging to the next parameter:
Code: Select all
UrlDownloadToFile, https://www.google.com/maps/vt/data=9KZnDfCpPlvTU8liZSxRK68iPgkpi9GbpD2FYCu5E0ZDk38075U0gI7qkeyXnksU1tgsFuLu3sa0b2uT_d87J6zH8Jque0tCB2Zz3m2g5ECC1R6oXlB65pD6zoerLOEc_wa_V-gCPfFgLBsF54iPUz0S6hDMh8FhON_qdm-l`,9QY-qAGDoGYenT4VpxyK99_2EdBJhiV33wqM88e8G-rUb3PjERXM1G1kXsPSZajXT9rdIsiDrL2uCFU0gtEvyDmU7oBKMNYc26wVv4hrJiHC7AiLniIL0HW8Jnh7IuOGza0hrrefT6GLccqwz-XoIcOA6JAFn3FwYRo9AWFxDtOHliX1Zfb12utHjjhDcuRYTkd3DwvbVxZ0gCdDtjBHogrJ9QtpP-A9na3zlGEmQ75J7emq2G1x-qye7ejGizzQzu_xWWAPb9fwj7MYISmU4X7pJebod3gk1nZWrr4yC_pppb0tFsf36Qp-_-IaxgpoSnbbu1qgxSg?scale=1&h=200&w=652, LAX.png
If you switch to AHK v2, you can avoid all the expression vs. legacy syntax confusion because expressions are used throughout.