Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 解析html页面中的数据_Android_Html_Parsing - Fatal编程技术网

Android 解析html页面中的数据

Android 解析html页面中的数据,android,html,parsing,Android,Html,Parsing,我正在开发一个android项目。我想访问网页的某些部分,但我如何才能访问?哪个解析器最适合此任务,以及如何使用此解析器。 我使用以下方法访问该网页,但现在想解析该网页 public void call_a_site() { try { Uri uri = Uri.parse( "http://www.dsebd.org/" ); startActivity(new Intent(I

我正在开发一个android项目。我想访问网页的某些部分,但我如何才能访问?哪个解析器最适合此任务,以及如何使用此解析器。 我使用以下方法访问该网页,但现在想解析该网页

public void call_a_site()
    {   
            try
        {      
            Uri uri = Uri.parse( "http://www.dsebd.org/" );
            startActivity(new Intent(Intent.ACTION_VIEW,uri));

        }

    catch(Exception e)
    {

    }
}
请帮忙。。
谢谢

查看JSoup食谱

这里面有很多好的信息,应该能够回答你的大部分问题


您可能正在寻找类似的东西:

Jsoup库是Html解析的最佳选择

步骤1:下载jsoup.x.x.x.jar
步骤2:在IDE的libs文件夹中导入
步骤3:设置为库

样本

        // Connect to the web site
        Document document = Jsoup.connect(url).get();
        // Using Elements to get the Meta data
        Elements description = document
                    .select("meta[name=description]");
        //Locate the content attribute
            desc = description.attr("content");
也许能回答你的问题。