java - Automating movement on a webpage

Well, I'm kinda new to mobile app development, but I have a fair amount of experience with Java. I stumbled upon CodeNameOne and thought I'd try to make an app based on "It's Learning". Unfortunately this site won't let me get straight to the logon page without going through the main portal first. So here's my question:

Is there any way (in CodeNameOne) to automate navigation on the web in the background and get information from the site, such as login and the newsfeed, then send data from the app and to the web page?

(Something like the way HtmlUnit works is what I'm looking for)

1 Answer

  1. Alex- Reply


    You can do some of that work using ConnectionRequest to simulate user interaction but that would probably be fragile as Andrew mentioned. The main issue is that they might change the site structure and your HtmlUnit code would break.

    What we do when faced with such a situation is create a server that abstracts the "scraping" behind a set of clearly defined REST API's. That way if the site design changes we just update the server to match the change and all the clients out there will work as usual without requiring an update.

    Naturally there is always a possibility of the site blocking you or even blocking your server IP address/range so Andrews advice of actually talking to the guys is sound advice.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>