Cael
06-17-2014, 07:41 PM
Hi, I am trying to extract an integer from a website's source code...
This is a snippet of the HTML coding of the website.
<div style="width:100%;"><div class=CatDiv ></span><br><span class=CatLevel1><a onclick="Javascript:ShowMeu('21');">Arts, Antiques & Collectibles</a> (4556)
</span><BR><span id=Cat21 style="display:none;"><span class=CatLevel2>
<a href="lelong.com.my/arts-antiques-and-collectibles/">View All</a> (10946)</span><br><span class=CatLevel2>
How can I get the integer value "10946" using maybe regex expression and don't retrieve the integer "4556"? I notice all the integer that I needed to retrieve has a "View All" in front and the class of "CatLevel2"(there are others element using the same class as this that I don't want to retrieve) so maybe I can use that as the pattern to retrieve the integer after it. Can anyone show me how? Thx.
This is a snippet of the HTML coding of the website.
<div style="width:100%;"><div class=CatDiv ></span><br><span class=CatLevel1><a onclick="Javascript:ShowMeu('21');">Arts, Antiques & Collectibles</a> (4556)
</span><BR><span id=Cat21 style="display:none;"><span class=CatLevel2>
<a href="lelong.com.my/arts-antiques-and-collectibles/">View All</a> (10946)</span><br><span class=CatLevel2>
How can I get the integer value "10946" using maybe regex expression and don't retrieve the integer "4556"? I notice all the integer that I needed to retrieve has a "View All" in front and the class of "CatLevel2"(there are others element using the same class as this that I don't want to retrieve) so maybe I can use that as the pattern to retrieve the integer after it. Can anyone show me how? Thx.