Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can you show us your code please?</p> <p>Btw. if you want to parse a website, it's better to use <code>connect()</code> instead of <code>parse()</code>.</p> <p>Here's an example how to get <code>&lt;div class="controlcontent_r"&gt;...&lt;/div&gt;</code> tags:</p> <pre><code>final String url = "http://www.jabraat.com/categories/Buy-Digital-Cameras-Online/cid-CU00084377.aspx"; Document doc = Jsoup.connect(url).get(); for( Element element : doc.select("div.controlcontent_r") ) { System.out.println(element); System.out.println(); } </code></pre> <p>This code prints three elements (separated by a blank line):</p> <pre><code>&lt;div class="controlcontent_r"&gt; &lt;div class="mtc-menu"&gt; &lt;ul class="mtc-cat"&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a mtc-selected" title="Go To Digital Cameras" href="http://www.jabraat.com/categories/Buy-Digital-Cameras-Online/cid-CU00084377.aspx"&gt;Digital Cameras&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go To Camcoders" href="http://www.jabraat.com/categories/Buy-Camcorders-Online/cid-CU00084380.aspx"&gt;Camcoders&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block1"&gt;&lt;a class="mtc-a" title="Go To Camera Accessories" href="http://www.jabraat.com/categories/Buy-Camera-Accessories-Online/cid-CU00084381.aspx"&gt;Camera Accessories&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="controlcontent_r"&gt; &lt;div class="mtc-menu"&gt; &lt;ul class="mtc-cat"&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go To Camera" href="http://www.jabraat.com/categories/Buy-Cameras-Online/cid-CU00084376.aspx"&gt;Camera&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go To Digital Photo Frames" href="http://www.jabraat.com/categories/Buy-Digital-Photo-Frames-Online/cid-CU00084382.aspx"&gt;Digital Photo Frames&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block1"&gt;&lt;a class="mtc-a" title="Go To Mobiles" href="http://www.jabraat.com/categories/Buy-Mobiles-Online/cid-CU00084383.aspx"&gt;Mobiles&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="controlcontent_r"&gt; &lt;div class="mtc-menu"&gt; &lt;ul class="mtc-cat"&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Watches" href="http://www.jabraat.com/categories/Buy-Watches-Online/cid-CU00084370.aspx"&gt;Watches&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Clothing" href="http://www.jabraat.com/categories/Buy-Online-Clothing/cid-CU00084420.aspx"&gt;Clothing&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Mobiles" href="http://www.jabraat.com/categories/Buy-Mobiles-Online/cid-CU00084383.aspx"&gt;Mobiles&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Cameras" href="http://www.jabraat.com/categories/Buy-Cameras-Online/cid-CU00084376.aspx"&gt;Cameras&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Home &amp;amp; Kitchen" href="http://www.jabraat.com/categories/Buy-Home-Kitchen-Appliances-Online/cid-CU00084391.aspx"&gt;Home &amp;amp; Kitchen&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Personal Care" href="http://www.jabraat.com/categories/Buy-Online-Personal-Care/cid-CU00084413.aspx"&gt;Personal Care&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block"&gt;&lt;a class="mtc-a" title="Go to Jewellery" href="http://www.jabraat.com/categories/Buy-Online-Jewellery/cid-CU00084429.aspx"&gt;Jewellery&lt;/a&gt;&lt;/li&gt; &lt;li class="mtc-block1"&gt;&lt;a class="mtc-a" title="Go to Footwear" href="http://www.jabraat.com/categories/Buy-Online-Footwear/cid-CK00101771.aspx"&gt;Footwear&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <hr> <hr> <h2>Edit:</h2> <p>As mentioned in the comments, things get more complicated with <code>&lt;div class='bucket'&gt;</code> tags. While you can easily parse the <code>controlcontent_r</code> tags using jsoup, the <code>bucket</code> looks to be generated by a script.</p> <p>You can do a simple test:</p> <pre><code>final String url = "http://www.jabraat.com/categories/Buy-Digital-Cameras-Online/cid-CU00084377.aspx"; Document doc = Jsoup.connect(url).get(); // Connect an parse the document (as above) System.out.println(doc); // Output the document (= how jsoup "see"'s the website) </code></pre> <p>There's no <code>bucket</code> tag in there, what means you can't retrieve it (with jsoup) - the solution is to use another library to execute scripts.</p> <p>Conveniently i've already posted a short list of of those here: <a href="https://stackoverflow.com/questions/13666453/trying-to-parse-html-hidden-by-javascript/14715242#14715242">Trying to parse html hidden by javascript</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload