Re: parsing online data ?
Re: parsing online data ?
- Subject: Re: parsing online data ?
- From: Jim Underwood <email@hidden>
- Date: Tue, 13 Mar 2018 09:12:59 +0000
- Thread-topic: parsing online data ?
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