i want to scan a particular webpage for a a particular link…
its everytime the same page and the link is also everytime on the same position on the webpage! only the file, which the link refers to, is each day a diffrent one!
i found a script that fits pasably…
its from an other post here of this site, i modiefied it a little bit (the downloadpart) and edited the image-placeholder to links-placeholder!
the problem with this script is, that it needs safari! otherwise it works fine!
so i dont know how to set the “linksURLtext” to a correct url like “www.test.de” to get the javascript started!
i tried it with tell application “URL Access Scripting”, but i dont get it to work!
and i also have no idea to get the script started once every day on a specific time!
i hope u can help me, to get it work!
thanks ahead!
stefnw
on getlinksURLs()
set js to "var linksURLtext = \"\";
var linksCount = document.links.length;
var lastLinksIndex = (linksCount - 1);
linksURLtext = document.links[1].href;
return linksURLtext;"
tell application "Safari" to set linksURLtext to (do JavaScript js in front document)
set linksURLs to {}
if ((count linksURLtext) > 0) then
set alllinksURLs to paragraphs of linksURLtext
considering case
repeat with i from 1 to (count alllinksURLs)
set thisURL to item i of alllinksURLs
if (thisURL is in linksURLs) then
else
set end of linksURLs to thisURL
end if
end repeat
end considering
end if
set the destination_file to ((path to desktop as string) & "bnn.zip")
tell application "URL Access Scripting"
download linksURLtext to destination_file replacing yes with progress
end tell
return linksURLtext
end getlinksURLs
getlinksURLs()