2010-10-17 86 views

回答

1

混戰,但它的作品...

tell application "Safari" 
    make new document with properties {URL:"http://www.google.com/search?q=define%3Acat"} 
    set theDocument to document 1 
    set theSource to source of theDocument -- result: source code for the page. 
end tell 

注意,搜索詞可以分隔符%3A後上漲到年底。從那裏,你將不得不從頁面上刮取你想要的東西,但即使是最好的語言也是如此。

+0

噢好吧。出於某種原因,它並沒有給我正確的來源。它在源文件中說,該頁面被禁止。奇怪的。當我捲曲它也會發生。有任何想法嗎? – objectiveccoder001 2010-10-20 13:52:35

+0

@Elijah W.,這對我來說非常合適。你嘗試過這個簡單的例子嗎? – 2010-11-07 23:49:31

相關問題