Re: parsing online data ?
Re: parsing online data ?
- Subject: Re: parsing online data ?
- From: Hermann BRILLANT <email@hidden>
- Date: Tue, 13 Mar 2018 10:13:31 +0000
Hi
Depends your restrictions, but if you have strong restrictions such as no
external ressources, also depends the kind of data to parse, but most of the
time I’m not allowed to use 3rd party. Then Applescript > shell script curl and
then I’ve been parsing html arrays in a smart way using regex or right now I’m
parsing JSON content with python run from a do shell script.
Not the most efficient, I totally agree, but I have to play within close limits.
What kind of content is it?
Kind Regards
Hermann Brillant
Apple Distribution International
> On 13 Mar 2018, at 09:12, Jim Underwood <email@hidden> wrote:
>
> Shane,
>
> We are both speculating about the starting conditions of the OP.
>
> Just because we are "scripting" does NOT necessarily mean that the browser is
> not already open with the page. In ALL cases, some scripting is being done.
> IME, in most cases, the user already has the web page open, and just wants
> get some data, or set some data on that page.
>
> So, scripting, in this case, simply means JavaScript injection, via
> AppleScript or other tool (like Keyboard Maestro). My point is that if, for
> whatever reason, the user already has the web page open, then one or two
> lines of JavaScript can often get the job done.
>
> If the web page is not already open, then the user will need to weigh the
> runtime cost of opening a web page in a browser, vs the development cost of
> using XPath in ASObjC plus downloading the web page source. I have found
> that most browsers, for sure the Chrome browser, is very fast, and in many,
> many cases makes my development time greatly less because I can use a
> well-known and used tool like JavaScript and the Chrome Dev Tools.
>
> Let me put it another way that most AppleScripters can relate to. Using
> Chrome Dev Tools with JavaScript vs ASObjC XPath is analogous to using Script
> Debugger vs Script Editor.
>
> Best Regards,
>
> Jim Underwood
> aka JMichaelTX
>
>
> From: AppleScript-Users
> <applescript-users-bounces+jmichael=email@hidden
> <mailto:applescript-users-bounces+jmichael=email@hidden>> on
> behalf of Shane Stanley <email@hidden
> <mailto:email@hidden>>
> Date: Tue, Mar 13, 2018 at 2:09 AM
> To: "ASUL (AppleScript)" <email@hidden
> <mailto:email@hidden>>
> Subject: Re: parsing online data ?
>
> On 13 Mar 2018, at 6:00 pm, Jim Underwood <email@hidden
> <mailto:email@hidden>> wrote:
> If you already have the web page open, then, IMO, it is more efficient to use
> a few lines of JavaScript to extract the text rather than re-downloading the
> entire source of the web page to use in ASObjC XML
>
> Agreed. But if you're going to the effort of scripting it, which is what the
> OP is asking about, then it's more efficient not to have to open the page in
> a browser at all.
>
> --
> Shane Stanley <email@hidden <mailto:email@hidden>>
> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden