Search code examples
javaformspost

Looking for a good/reliable API for non GUI website interaction


Basically I want to gather statistics of searches on various search engines (Google, Yahoo, etc), I want to check how many searches of specific phrases/words wore made and store the information in a file, then use this information for article tagging on my web site. Until now I was doing this by hand using Google Trends.

Basic requirements are:

  • Login

  • Manipulating HTML DOM Elements including opening spans/showing forms(basically taking any action needed to reveal the needed form)

  • Editing fields of a form(mostly for the data input)

  • Submitting forms

  • Retrieving relevant information from the webpage after form submission

Java API is prefered but not a must, basically any language will do as long as the API is "transparent" and simple enough so I wont have to spend days learning how to work with it.

I looked at this question which suggested the use of selenium for this kind of purpose, it seems good enough to try it, but since its a year old question I was wondering if there are another options.


Solution

  • This site lists some alternatives to selenium.

    That being said, I have used selenium and found it to be quite flexible. You can also set it up in headless mode, which would allow the Java application to work without the need of a GUI (can be useful if you have a remote server to do the work, but has no monitor).

    The only major issue I had with it (selenium) was that I was using Firefox versions which it still did not support, so you might want to keep an eye on that.

    Another note, if you will be using it from a low power device, such as a Raspberry Pi, be sure that add the implicit timeouts.