0

So, I need to write software that automates some browser tasks for me. Nothing fancy (clicking and getting data from the webpage). I want to use Java. Can you point me in a direction where to look/start, like libraries?

Thanks in advance! Cheers

Tropicano
  • 281
  • 2
  • 15
  • 1
    Try this link for selenium with java, https://www.selenium.dev/documentation/en/ – Animesh Sharma Nov 12 '20 at 00:22
  • 1
    Personally i would advise using something like python for this, but this link may be a place to start: https://stackoverflow.com/questions/6159118/using-java-to-pull-data-from-a-webpage – blueberry Nov 12 '20 at 00:22

1 Answers1

2

It is written for the purpose of running automated tests against websites, but you could use it for this job too: Selenium.

However, before you try to automate an entire browser, check if the service you're connecting to has an API, because otherwise your script will definitely just break if the site updates its styles a bit.

Even if there is no API, check if the answers you are looking for are just sent in the HTML - if so, just load the page with JSoup and parse the answer right out, no need to start or script any browsers.

rzwitserloot
  • 85,357
  • 5
  • 51
  • 72