
mServer.crawler.sender.wdr.HtmlDeserializerBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of MServer Show documentation
Show all versions of MServer Show documentation
The crawler for mediathekview/MediathekView
package mServer.crawler.sender.wdr;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public class HtmlDeserializerBase {
public static final String QUERY_META_ITEMPROP = "meta[itemprop=%s]";
public static final String QUERY_META_NAME = "meta[name=%s]";
public static final String QUERY_META_PROPERTY = "meta[property=%s]";
public static final String HTML_ATTRIBUTE_CONTENT = "content";
public static final String HTML_ATTRIBUTE_HREF = "href";
public static final String HTML_ATTRIBUTE_TITLE = "title";
protected String getMetaValue(Document document, String query, String itempropName) {
String value = "";
query = String.format(query, itempropName);
Element element = document.select(query).first();
if (element != null) {
value = element.attr(HTML_ATTRIBUTE_CONTENT);
}
return value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy