I need to get one value from all meta tags:
Elements elements= document.getElementsByTag("meta");
I will get these elements:
<meta name="twitter:image" content="https://lh3.googleusercontent.com/0daLqxVdiOGXvHI1R5aUFf_6znVlBHMturM9SXnpOQagADdYJDycyPzT-btcntR4jW4=w600-h300-pc0xffffff-pd">
<meta name="appstore:developer_url" content="http://www.verylittlenightmares.com">
<meta name="appstore:bundle_id" content="eu.bandainamcoent.verylittlenightmares">
<meta name="appstore:store_id" content="eu.bandainamcoent.verylittlenightmares">
<meta itemprop="price" content="200,00 $">
<meta itemprop="url" content="https://play.google.com/store/apps/details?id=eu.bandainamcoent.verylittlenightmares&rdid=eu.bandainamcoent.verylittlenightmares&feature=md&offerId">
How can i get value (200,00 $) from this attribute?
<meta itemprop="price" content="200,00 $">
private String getPrice(Document document) {
Elements elements= document.getElementsByTag("meta");
for (Element metaTag : elements) {
String content = metaTag.attr("content");
String itemprop = metaTag.attr("itemprop");
if ("price".equals(itemprop)) {
return content;
}
}
return null;
}