Re: Downloading a file from the internet with a URL
Re: Downloading a file from the internet with a URL
- Subject: Re: Downloading a file from the internet with a URL
- From: Enrique Terrazas <email@hidden>
- Date: Fri, 13 May 2016 20:33:19 +0200
This URL:
<http://www.linuxjournal.com/content/reading-web-comics-bash-script?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+linuxjournalcom+(Linux+Journal+-+The+Original+Magazine+of+the+Linux+Community)>
shows how to download all img tags from a webpage using wget and xmllint. It can probably be modified to download other types of files.
> On May 13, 2016, at 1:19 PM, Emmanuel LEVY <email@hidden> wrote:
>
> For those interested, if you need to download some html file, you can use Smile's readtext command, like in:
>
> ----
> writetext (readtext "https://support.apple.com/fr-fr/HT1582") to "/Users/emmanuel/Desktop/downloaded-file.html"
> ----
>
> Best,
> Emmanuel
>
> On May 13, 2016, at 1:58 AM, Stockly, Ed wrote:
>
>>
>>>
>>> Note that the curl script will download one file, if you want the
>>> pictures or other kind of files, you have to find them and download them
>>> separately.
>>>
>>
>> That's good to know. In this case I'm simply downloading zip files and
>> pdfs, so all I need is the one file with each download.
>>
>>
>> Here's the handler I'll be using, with handler calls:
>>
>>
>> set fileToDownload to "https://support.apple.com/fr-fr/HT1582"
>> set localPath to "/Users/user/myLocalFileName6.html"
>> DownloadFile(fileToDownload, localPath)
>> set localPath to "/Users/user/myLocalFileName7.html"
>> DownloadFile(fileToDownload, localPath)
>> set localPath to "/Users/user/myLocalFileName8.html"
>> DownloadFile(fileToDownload, localPath)
>>
>> on DownloadFile(fileToDownload, localPath)
>> set fileToDownload to quoted form of fileToDownload
>> set quotedlocalPath to quoted form of localPath
>> set downloadShell to "curl " & fileToDownload & " >> " & quotedlocalPath
>> set shellResult to do shell script downloadShell
>> delay 2
>> tell application "System Events" to set localPath to POSIX file
>> localPath as alias
>> tell application "Finder" to reveal localPath
>> return localPath
>> on error errMsg
>> return errMsg
>> end try
>> end DownloadFile
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden