user224567893
user224567893

Reputation: 656

How to hit a website programmatically in Java?

I am trying to find out how to hit a website programmatically using the JDK 6 tools, but I'm unable to find examples of this. I need to be able to go to a website and enter the username and password in the corresponding fields.

The closest thing I was able to find was this example, but it is using .NET: http://blog.scosby.com/post/2010/01/19/Hitting-a-web-page-programmatically.aspx .

Through some research, I found that you might need to use the URL and URLConnection libraries to hit a website programmatically. But I would like to see an example of how to accomplish this, as I'm new to these libraries and don't know how to use them (also, I'm not 100% sure those are the libraries that I should use).

Thanks in advance.

Upvotes: 0

Views: 282

Answers (1)

macking_liu
macking_liu

Reputation: 56

Why not try using Selenium? And you can write code with Java, C# or Python

Upvotes: 1

Related Questions