求适配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
相关产品推荐
相关产品推荐

