org.jsoup.nodes.Document.getElementsByAttributeValueMatching()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.jsoup.nodes.Document.getElementsByAttributeValueMatching()方法的一些代码示例,展示了Document.getElementsByAttributeValueMatching()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.getElementsByAttributeValueMatching()方法的具体详情如下:
包路径:org.jsoup.nodes.Document
类名称:Document
方法名:getElementsByAttributeValueMatching

Document.getElementsByAttributeValueMatching介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Document doc = null;
 try
 {
   doc = Jsoup.parse("<html> " + "<head>  " + "<title>My webpage</title> "
       + "</head> <body>  <div class=\"container\">     " + "<div class=\"comment foo\">      "
       + "<p>This is comment</p>    " + " </div>  </div> </body></html> ");
   Elements comments = doc.getElementsByAttributeValueMatching("class", "comment");
   Iterator<Element> iter = comments.iterator();
   while(iter.hasNext())
   {
     Element e = iter.next();
     System.out.println(e.getElementsByTag("p").text());
   }
 }
 catch (Exception e)
 {
   e.printStackTrace();
 }

代码示例来源:origin: org.tinymediamanager.plugins/scraper-ofdb

Document doc = Jsoup.parse(in, "UTF-8", "");
in.close();
Elements filme = doc.getElementsByAttributeValueMatching("href", "film\\/\\d+,");
if (filme == null || filme.isEmpty()) {
 LOGGER.debug("found no search results");

代码示例来源:origin: org.tinymediamanager.plugins/scraper-ofdb

in.close();
filme = doc.getElementsByAttributeValueMatching("href", "film\\/\\d+,");
LOGGER.debug("found " + filme.size() + " search results");
in.close();
filme = doc.getElementsByAttributeValueMatching("href", "film\\/\\d+,");
LOGGER.debug("found " + filme.size() + " search results");

代码示例来源:origin: org.tinymediamanager.plugins/scraper-ofdb

el = doc.getElementsByAttributeValueMatching("href", "plot\\/\\d+,");
if (!el.isEmpty()) {
 String plotUrl = BASE_URL + "/" + el.first().attr("href");

相关文章