我用htmlUnit获取的页面中报这样的错误
Microsoft VBScript runtime
error '800a01a8'
Object required: 'RS'
/idxrad/ptlookup/ExamList.asp, line 360
代码中我打印出来了response回来的整个页面代码。在报错误之前,其中所有的javascript的function都打印出来了。接着就是这个错误。
这是怎么回事呢?我的代码如下:
                  final WebClient webClient = new WebClient();
                URL utl2 = new URL("http://10.40.10.31/idxrad/ptlookup/ExamList.asp");
WebRequestSettings wr1 = new WebRequestSettings(utl2, HttpMethod.GET); NameValuePair nv1 = new NameValuePair("PatientID", "238752");
NameValuePair nv2 = new NameValuePair("OrgID", "-1");
NameValuePair nv3 = new NameValuePair("SearchStatusStr",
"'O'%2C'S'%2C'X'%2C'I'%2C'C'%2C'N'%2C'D'%2C'P'%2C'F'%2C'R'%2C'A'");
NameValuePair nv4 = new NameValuePair("ActionStatusStr", "OSXICNDPFRA");
NameValuePair nv5 = new NameValuePair("FromDT", "BEGINNING");
NameValuePair nv6 = new NameValuePair("ToDT", "end");
NameValuePair nv7 = new NameValuePair("SelectMode", "R");
NameValuePair nv8 = new NameValuePair("SearchType", "A");
NameValuePair nv9 = new NameValuePair("ExamListMode", "ReadOnly");
List<NameValuePair> ll2 = new ArrayList();
ll2.add(nv1);
ll2.add(nv2);
ll2.add(nv3);
ll2.add(nv4);
ll2.add(nv5);
ll2.add(nv6);
ll2.add(nv7);
ll2.add(nv8);
ll2.add(nv9);
wr1.setRequestParameters(ll2); webClient.setCssEnabled(false);
webClient.setJavaScriptEnabled(false); // ignore the javascript error
final HtmlPage page3 = (HtmlPage) webClient.getPage(wr1);
page3.initialize(); System.out.println(page3.getWebResponse().getRequestUrl());
System.out.println(page3.getWebResponse().getContentAsString());
谢谢高手指点。