Looking for an Safari extension (or plugin) what acts as mozrepl, what works like a charm. 🙂
- Exists such thing?
If not, is possible somewhat easily control Safari from external scripts (perl, python, bash)? With control mean:
GET
urls (mean http GET method) – Via safari (e.g. the Safari will send the auth, session cookies, referere and so on).- get source of the page (after the Safari renders all ajax calls and such)
POST
via Safari (for example using AJAX – but initieted from teh external script)- etc…
- in short like: "mozrepl" 🙂
Seems, here is nothing comparable yet. I didn't delete the question, is someone found such thing – please add an answer.
Ps: i know, how to use curl
or like tools, but this isn't helps for e.g. grabbing a content of pages, where Safari managing the session authentication, cookies, referrers , user-agent strings and so on. Everything is rev-engineerable, but it is much easier to use a tool like mozrepl
as doing the fullstack rev-engineering for getting scriptable web-sessions…)
Best Answer
If the main idea is scripting Safari, I would try using Automator before trying AppleScript. I'd start by hitting the record button and then:
GET
by saving the webpage sourceOr you could try AppleScript with something like this:
You can add to the script form fills and submit buttons with javascript:
I'd try this out within the JavaScript console within a web browser first to make sure you have the names of everything correct.