how to use htmlunit with my android project

前端 未结 3 1613
灰色年华
灰色年华 2020-12-02 00:48

I have downloaded htmlunit 2.11 zip. i have extract it. then i have tried to paste them in my project\'s libs folder. from the libs folder i have added them in build path. t

相关标签:
3条回答
  • 2020-12-02 01:19

    Here are the steps to follow:

    1. Download the latest version of HtmlUnit from http://sourceforge.net/projects/htmlunit/files/htmlunit/2.11/
    2. Unzip downloaded file
    3. Go to lib folder --> Right click on htmlunit-core-js-2.11.jar and select 'copy'
    4. Go to Package Explorer in Eclicse --> Chose your project --> Right click on libs folder and select 'paste'
    5. Right click on the newly added file and click on 'Add as a library...' and select your project.
    6. Repeat steps 3, 4 and 5 for the htmlunit-2.11.jar file
    7. Add this two imports to your project:

      import com.gargoylesoftware.htmlunit.WebClient;

      import com.gargoylesoftware.htmlunit.html.HtmlPage;

    8. Clean the project.

    Please also check this link http://www.aviyehuda.com/blog/2011/05/16/htmlunit-a-quick-introduction/ for the htmlUnit quick introduction

    0 讨论(0)
  • 2020-12-02 01:20

    sorry, i have lost all my hope on HTMLUNIT. :( to gain my goal i have used HttpUrlConnection & Jsoup ... that works for me. here is my procedure i have post my code in answer.

    0 讨论(0)
  • 2020-12-02 01:31

    Nothing of this will work because he is trying to include HtmlUnit into a android project. HtmlUnit is not compatible with android because is refernces some java.* & javax.* classes which are not available in android.

    Hope there will come a version for android.

    0 讨论(0)
提交回复
热议问题