Java HTML Jsoup Element getFirstWithOwnText(final Elements elementList, final String text)

Here you can find the source of getFirstWithOwnText(final Elements elementList, final String text)

Description

get First With Own Text

License

Open Source License

Declaration

static Optional<Element> getFirstWithOwnText(final Elements elementList, final String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Optional;

import org.jsoup.nodes.Element;

import org.jsoup.select.Elements;

public class Main {
    static Optional<Element> getFirstWithOwnText(final Elements elementList, final String text) {
        return elementList.stream().filter(el -> el.ownText().equals(text)).findFirst();
    }/*  w w  w .ja va2  s .  c o m*/
}

Related

  1. getElementsByClass(String className, Element boardElement)
  2. getElementsFirstLevel(String html)
  3. getElementTextBySelector(String html, String selector)
  4. getElementValue(Element wrapperElement, String cssQuery)
  5. getElIndexInSameTags(Element e)
  6. getFormattedText(Element element)
  7. getIndustry(Element element)
  8. getInt(Elements td, int i)
  9. getLink(Element element, int index)