Parsing HTML with javascript outside of a browser

Okay I know this is going to sound crazy but is there any way to parse html outside the context of a browser. We are using a 3rd party app that runs as a service to monitor email inboxes and it uses a javascript file to “Do Stuff” with the email. So the only access I have to this 3rd party app is being able to edit the javascript file that it runs. It passes in an eMail object where I can access the eMail.Body. The email is using html and it has tags to identify specific information. I need to parse that information out to get the specific data. Since it’s not running inside of a browser I don’t have access to the DOM so I can’t use the document.getElementById method. Does anyone know of a way to take that html and parse it out and get the information I need? Again this is outside the context of a browser and I only have access to a .js file that I can edit. Thanks :slight_smile:

Do you know what is running the .js file? Node.js? A headless webkit? Something else?

Hi ScallioXTX,

Unfortunately I don’t know. It’s Sage CRM’s EmailManager if you are at all familiar with that. It’s an .exe that runs as a service. That’s all I know :frowning: Is there a way to tell? Is there some sort of monitor/utility that I can run to tell what it’s using? Thanks.

I don’t think there is any way to tell. At least not that I know off.
I think at this point it would be better if you ask the author of the software if they can help you, since all you and I can do is guess.

That’s what I was afraid of :frowning: Would there be functions/methods that only exist in node.js or some other webkit that I could try to run inside the javascript to see if it fails or works? I’ll see if I can find out what it’s using and reply to this post if I find anything out. Thanks for your help :slight_smile:

Oooooh Sage… don’t you love them! :sigh:

I have to deal with their Virtual TPV software from time to time… and I don’t have words to express my feelings towards them.

Unfortunately, you’ll have to give them a call and ask them if they can help you with whatever you need. Else, you can do a bit of reverse ingeneering and sniff what the .exe file does. It is never exact but it may give you an idea.

lol. Yeah it’s been interesting working with Sage products, especially with Sage 300 ERP which is written in VB6!!! Sometimes you just gotta work with the hand that’s dealt to you :slight_smile: Thanks for the advice molona.