I
I
Innokenty Ivanov2015-04-04 07:52:47
JavaScript
Innokenty Ivanov, 2015-04-04 07:52:47

How to create a mobile parser application using JS?

I need to write a mobile application (HTML + JS) that will read information from the site, without cache servers, pars servers. Generally no support. The site does not have an API. Plus, the limitation is to use only JS, preferably as clean as possible, without JQ and other bibles, without regular expressions and other things - since the author does not have much knowledge of JS.
How to implement this? And how should it work?
I have ideas:
1. The application connects to the site, searches for everything by structure, saves only certain pieces of information.
or
2. The application keeps the entire HTML structure on its own, then parses it:
____2.1. Regulators - no, I don't want to.
____2.2. Serialization to objects or JSON. Or whatever it's called.
____2.3. Some third party selector library
or
3. The application injects all the saved structure directly into its markup, and then document.querySelector() and off we go. Best crutch ever!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Kitmanov, 2015-04-05
@Kenya-West

You will not parse HTML with regulars .
Cross-domain XHR (in PhoneGap this does not seem to be a problem) get the page - then call querySelectorAll on the responseXML ("nothing needs to be embedded") and off we go.

D
Deodatuss, 2015-04-04
@Deodatuss

phantom js, but I have no idea how to put it into a mobile phone

E
Elios, 2015-04-23
@strelov1

It will be easier to make a server-side parser on phyton, php or the same js that will give json with the necessary data upon request of the application. Most recently, I did something like this https://play.google.com/store/apps/details?id=com....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question