JSOUP-从HTML获取textarea的价值-停止营业 [英] JSOUP - Getting value of textarea from HTML - CLOSED

查看:272
本文介绍了JSOUP-从HTML获取textarea的价值-停止营业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用JSOUP,并且试图在textarea中获取值.以下是HTML中的元素信息;

I've just started using JSOUP and I'm trying to get the value in the textarea. The below is the element info from the HTML;

下面是我用来尝试读取textarea中的值的代码;

The below is the code that I'm using to attempt to read the value in the textarea;

    try {
        String html = "http://aviprobo.doorfree.com/control.html";
        Document doc = Jsoup.connect(html).get();
        Element textarea = doc.getElementById("control");
        System.out.println("textarea value = " + textarea.val());
    } catch (IOException e) {
        //
    }

textarea.val()的值为空.有人能指出我正确的方向吗? 谢谢.

The value of textarea.val() is empty. Could someone please point me in the right direction. Thanks.

推荐答案

Document doc = Jsoup.connect("http://sports.163.com/13/0830/22/97IFSI5I00051CD5.html").get();

**Entities.EscapeMode.base.getMap().clear();**

Elements elements = doc.select("textarea[id^=photoList]");

for(Element e:elements){
    System.out.println(e.html());
}

这篇关于JSOUP-从HTML获取textarea的价值-停止营业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆