I'm back at trying to get HTMLUnit working and I was able to implement it into the project but I'm having some difficulties with it.. I want to track a package via DHL's website and it gives me an error in the console. The whole purpose is for the program to insert the DHL tracking number in the tracking text box, and then for the program to "click" the search button and get the tracking results. I am aware of DHL's API, but this is a school project and I'm trying to learn how to do something like this.
Here is my current code:
This is the error I get in the console:
WARNING: Unimplemented behavior: #default#userdata
Exception in thread "main" com.gargoylesoftware.htmlunit.ElementNotFoundException: elementName=[*] attributeName=[name] attributeValue=[sbtc]
If you look more closely at the page source, the textarea for entering tracking numbers on that page has a name of "AWB" and an id of "AWB_crossrefpar1_taskcenter_taskcentertabs_item1229046233349_par_expandablelink_insideparsys_fasttrack".
The best ideas are the crazy ones. If you have a crazy idea and it works, it's really valuable.—Kent Beck