简体   繁体   English

如何从android中的html网站提取文本

[英]how to extract text from a html website in android

I want to develop an android application which takes a particular input from the app and gives it to a website, then the website fetches the result. 我想开发一个Android应用程序,该应用程序从应用程序中获取特定输入并将其提供给网站,然后该网站获取结果。 I want to display this result from the website and display it in the android app. 我想从网站上显示此结果并将其显示在android应用中。 I tried using xml parsing but the website is not a xml based website. 我尝试使用xml解析,但该网站不是基于xml的网站。 The website is http://www.fastvturesults.com/ and the input is a roll number(usn number). 该网站是http://www.fastvturesults.com/ ,输入的是卷号(usn号)。 Can anyone guide me on how to fecth the result from this site and parse it to the app. 谁能指导我如何从该网站获取结果并将其解析到应用程序。

Use JSOUP which extracts datas from website and display the result. 使用JSOUP从网站提取数据并显示结果。

   Document document = Jsoup.connect(url).get();
            // Get the html document title
            String title = document.title(); //get title
    Elements description = document
                    .select("meta[name=description]");
            // Locate the content attribute
            String desc = description.attr("content");

and so on. 等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM