0

My goal is to get a Apple script running that can pull text from the top 50 apps and put them into a spread sheet with a few different columns. One for rank, App Name, and download link.

Heres the link: http://www.apple.com/itunes/charts/free-apps/

I'm not the best apple scripture but any advice or code would be VERY much appreciated. Thanks for listening!

4

1 回答 1

1

I don't have numbers but I'm sure you can figure out the rest...

tell application "Safari"
    set myUrls to do JavaScript "var hitList = [];
    for (i = 0; i<50; i++)
    {
    hitList.push(document.getElementsByTagName('strong')[i].parentNode.childNodes[1].href)
    }
    hitList;" in document 1

    set appNames to do JavaScript "var hitList = [];
    for (i = 0; i<50; i++)
    {
    hitList.push(document.getElementsByTagName('strong')[i].parentNode.childNodes[2].childNodes[0].childNodes[0].nodeValue)
    }
    hitList;" in document 1
end tell

display dialog "1st App name: " & item 1 of appNames & return & "1st URL: " & item 1 of myUrls
于 2013-01-28T04:59:30.890 回答