2010-10-17 90 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

相关问题