0
我想從另一個div類的div類中提取一個href。代碼段我想使用的一個例子是:用jsoup從另一個div類中提取div類
<div class="productData">
<div class="productTitle">
<a href="http://rads.stackoverflow.com/amzn/click/0786866020"> Fish! A Remarkable Way to Boost Morale and Improve Results</a>
<span class="ptBrand">by <a href="/Stephen-C.-Lundin/e/B001H6UE16">Stephen C. Lundin</a>, <a href="/Harry-Paul/e/B001H9XQJA">Harry Paul</a>, <a href="/John- Christensen/e/B003VKXJ04">John Christensen</a> and Ken Blanchard</span>
<span class="binding"> (<span class="format">Hardcover</span> - Mar. 8, 2000) </span>
</div>
我試圖從這個例子中提取innter類productTitle但是使用的代碼:
Document doc = Jsoup.connect(fullST).timeout(10*1000).get();
Element title = doc.getElementById("div.productTitle");
System.out.println(title);
我得到空。試圖提取更高的元素,如:
Element title = doc.getElementById("div.productData");
我也收到null。我已經嘗試了許多代碼組合,但無法弄清楚從內部div類或內部ID提取的語法。
任何幫助,將不勝感激。