You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求适配Android 6的无GUI网页抓取表单提交JS支持库

寻求兼容Android 6的无GUI浏览器库推荐

我正在开发一款可程序化填充网页表单并将响应返回至APP的应用,目前使用htmlunit-android实现功能,它运行正常但不兼容Android 6系统。由于大量用户使用Android 5和6系统,我需要让应用适配Android 6。

我当前基于htmlunit的实现代码如下:

private fun submittingForm() {
       
        val webClient = WebClient()

            // Get the first page
            val page1 = webClient.getPage<HtmlPage>("http://some_url")

            // Get the form that we are dealing with and within that form,
            // find the submit button and the field that we want to change.
            val form = page1.getFormByName("myform")
            val button = form.getInputByName<HtmlSubmitInput>("submitbutton")
            val textField = form.getInputByName<HtmlTextInput>("userid")

            // Change the value of the text field
            textField.type("root")

            // Now submit the form by clicking the button and get back the second page.
            val page2 = button.click<HtmlPage>()
        }

我已多日寻找无GUI浏览器库,但均不符合需求。jsoup无法满足需求,因为它不支持JavaScript。

我的需求如下:

  • 可获取网页数据的库
  • 支持JavaScript(加载页面JS并在执行后渲染页面)
  • 可提交表单并获取结果

请问有谁能推荐符合要求的库?

内容的提问来源于stack exchange,提问作者Maruf Rien

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.12 08:25:20