1

Web サイトにログインして (POST を使用)、HTML を解析しようとしています。ログインは (jsoup を使用して) 機能しますが、ページ全体を解析しようとすると、入力ストリーム バッファーがページ全体をキャプチャするのに十分な大きさではありません。

public String Test() throws Exception {

    Log.d(TAG, "-->>> STARTING TEST");
    WebConversation wc = new WebConversation();
    WebRequest     req = new GetMethodWebRequest( "http://www.meterware.com/testpage.html" );
    WebResponse   resp = wc.getResponse( req );
    // Log.d(TAG, "Response : " + resp.toString());
    return resp.toString();
}

エラーが発生します:

06-21 20:12:52.945: W/dalvikvm(414): Lcom/meterware/httpunit/javascript/ScriptingEngineImpl のスーパークラスを解決できません。(826)

すべての助けに感謝します。別のパーサーに切り替えることを意味する場合でも.. (これまでのところ、私は jsoup、htmlutil、および httputil を試しました).. すべて独自の問題があります。httpUtil が最後に更新されたのは 2008 年 (?) であることがわかりました。また、GETリクエストでCookieを送信できるものが必要です..

私のログ:

06-21 20:12:52.945: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/javascript/ScriptingEngineImpl; (826)
06-21 20:12:52.945: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/javascript/ScriptingEngineImpl;' failed
06-21 20:12:52.945: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/dom/AbstractDomComponent; (279)
06-21 20:12:52.945: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/dom/AbstractDomComponent;' failed
06-21 20:12:52.955: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/dom/DomWindow; (201)
06-21 20:12:52.955: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/dom/DomWindow;' failed
06-21 20:12:52.955: E/dalvikvm(414): Could not find class 'com.meterware.httpunit.dom.DomWindow', referenced from method com.meterware.httpunit.WebResponse.createDomScriptingHandler
06-21 20:12:52.955: W/dalvikvm(414): VFY: unable to resolve new-instance 211 (Lcom/meterware/httpunit/dom/DomWindow;) in Lcom/meterware/httpunit/WebResponse;
06-21 20:12:52.955: D/dalvikvm(414): VFY: replacing opcode 0x22 at 0x0006
06-21 20:12:52.989: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/javascript/ScriptingEngineImpl; (826)
06-21 20:12:52.989: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/javascript/ScriptingEngineImpl;' failed
06-21 20:12:53.006: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/dom/AbstractDomComponent; (279)
06-21 20:12:53.006: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/dom/AbstractDomComponent;' failed
06-21 20:12:53.015: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/dom/NodeImpl; (201)
06-21 20:12:53.025: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/dom/NodeImpl;' failed
06-21 20:12:53.025: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/dom/DocumentImpl; (256)
06-21 20:12:53.035: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/dom/DocumentImpl;' failed
06-21 20:12:53.045: W/dalvikvm(414): Unable to resolve superclass of Lcom/meterware/httpunit/dom/HTMLDocumentImpl; (207)
06-21 20:12:53.045: W/dalvikvm(414): Link of class 'Lcom/meterware/httpunit/dom/HTMLDocumentImpl;' failed
06-21 20:12:53.045: E/dalvikvm(414): Could not find class 'com.meterware.httpunit.dom.HTMLDocumentImpl', referenced from method com.meterware.httpunit.WebResponse.createDomScriptingHandler
06-21 20:12:53.045: W/dalvikvm(414): VFY: unable to resolve check-cast 224 (Lcom/meterware/httpunit/dom/HTMLDocumentImpl;) in Lcom/meterware/httpunit/WebResponse;

/edit : コンソール ウィンドウでこれを見つけました。それは私に再コンパイルする手がかりを与えました。そこで、httpUnit のソースを取得して「jar cf * *」を発行しました。しかし、その jar をプロジェクトに追加したときに、そのメソッドにアクセスできませんでした?!

[2012-06-21 22:12:06 - Mobile] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.meterware.httpunit.Button$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

.jar を再コンパイルしようとしましたが、うまくいきませんでした。そのプロセスで何か間違ったことをしたのかもしれませんが、それが解決策でしょうか?

4

0 に答える 0