Html JSOUP-提取Div标记的数据

Html JSOUP-提取Div标记的数据,html,jsoup,Html,Jsoup,你好,我在试着提取价格。有人能帮我吗?这个价格没有产出 Html 根据您的选择span[id=prod\u pricebox\u price],您正在尝试选择id为prod\u pricebox\u price的span元素,该元素在此文档中不存在 您可能想尝试类似于spanprice\u box的东西,它应该为您提供元素RM 449.00,使用字符串price=doc。选择[class=product price].text;。 您使用的选择器属于页面上运行的某些JavaScript,因此JS

你好,我在试着提取价格。有人能帮我吗?这个价格没有产出

Html


根据您的选择span[id=prod\u pricebox\u price],您正在尝试选择id为prod\u pricebox\u price的span元素,该元素在此文档中不存在

您可能想尝试类似于spanprice\u box的东西,它应该为您提供元素RM 449.00,

使用字符串price=doc。选择[class=product price].text;。
您使用的选择器属于页面上运行的某些JavaScript,因此JSUOP对它没有用处。

仍然没有输出@gigadotTry spanprice_box@pshemo你能帮帮我吗
<div id="product-price-box" class="prod_pricebox price_details" property="gr:hasPriceSpecification">
    <div class="prod_pricebox_price">
        <div class="prod_pricebox_price_final">
            <span id="product_price" class="hidden">389.00</span>
            <span id="special_price_box">RM 389.00</span>
        </div>
        <div id="special_price_area" class=" prod_pricebox_price_special">
            <span id="product_special_price_label">Before</span>
            <span class="price_erase">
                <span id="product_price_prefix" class="price-prefix-detail"></span>
                <span id="price_box">RM 449.00,</span>
            </span>
        <div class="prod_saving">
            <span id="product_saving_label">You save</span>
            <span id="product_saving_percentage" class="price_highlight"> 13%</span>
        </div>
    </div>
</div>
String url = "http://www.lazada.com.my/asus-zenfone-c-zc451cg-16gb-white-2801812.html";
Document doc = Jsoup.connect(url).get();

//Document doc = Jsoup.connect("http://www.lazada.com.my/").followRedirects(true).get();
String title = doc.title();
System.out.println("title is: " + title);  
String price = doc.select("span[id=prod_pricebox_price]").text();
System.out.println("Price is: " + price);