Web page Description and Keywords

How to get current Safari web page Description and Keywords.

Hi cirno,

parse the source:

tell application "Safari" to set a to source of document 1
set {TID, text item delimiters} to {text item delimiters, "<meta name=\"description\" content="}
set description to text item 2 of a
set text item delimiters to "<meta name=\"keywords\" content="
set keywords to text item 2 of a
set text item delimiters to " />"
set description to text item 1 of description
set keywords to text item 1 of keywords
set text item delimiters to TID
display dialog "Description: " & return & description
display dialog "Keywords: " & return & keywords