我需要编写一个简单的java函数,它接受一个URL并处理JavaScript中的响应,我尝试使用HttpUrlConnection,但它不能。有没有用于处理javascript响应的java库?
感谢。
编辑:我的代码:
Url url = new url("https://login.live.com/oauth20_authorize.srf");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
BufferedReader reader = new BufferedReader( new InputStreamReader(url.openStream()));
while(reader.readLine()!=null){
System.out.println(reader.readLine());
响应:
<html dir="..... Windows Live ID requires JavaScript to sign in. This web browser either does not support JavaScript, or scripts are being blocked......<body onload="evt_LoginHostMobile_onload(event);">
但我想阅读那些javascript响应。在java中有可能吗?