>>892
pythonからapplescriptを使って
safari で開いているページのソースを保存

勉強のためなんだろうけど
使い所がよくわからないけどこんな感じ

import os
import sys
import subprocess

cmd="""
osascript -e '
tell application "Safari"
set htmlContent to (source of document 1)
end tell
'
"""
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
a=proc.stdout.read()

f=open("/Users/noah02/Documents/safari.html", "wb")
f.write(a)
f.close()