Hamid
Hamid

Reputation: 3052

how parse HTML in Objective C

Any body could help me please! I want to parse some HTML code from web for Objective C, the HTML codes are like bellow:

<div class="linkSummary">
<a href="video_page.php?id=2309"><img class="video_thumbnail" width="120" height="90" src="video_thumbnails/vthumb_2309.jpg"></a>


<div class="video_title"><a href="video_page.php?id=2309">المپیک لندن؛ اهداء مدال کشتی فرنگی ۵۵ کیلوگرم </a></div>
<div class="video_league"><a href="videos.php?cupID=23">المپیک لندن</a></div>
<div class="video_date">&#1777;&#1781; &#1605;&#1585;&#1583;&#1575;&#1583; &#1777;&#1779;&#1785;&#1777; (<span dir="ltr">5 August 2012</span>)</div>
<div class="send_details">
    <span class="icon_holder"><img width="22" height="25" class="rollover v1" src="image_slices/icon_ball_off.jpg" hover="image_slices/icon_ball_on.jpg" vid="1" otid="4" oid="2309"><img width="22" height="25" class="rollover v2" src="image_slices/icon_yellow_off.jpg" hover="image_slices/icon_yellow_on.jpg" vid="2" otid="4" oid="2309"><img width="22" height="25" class="rollover v3" src="image_slices/icon_red_off.jpg" hover="image_slices/icon_red_on.jpg" vid="3" otid="4" oid="2309"></span>&#1578;&#1575; &#1575;&#1604;&#1575;&#1606; &#1777;&#1780; &#1606;&#1592;&#1585; &#1583;&#1585; &#1605;&#1608;&#1585;&#1583; &#1575;&#1740;&#1606; &#1608;&#1740;&#1583;&#1740;&#1608; &#1583;&#1575;&#1583;&#1607; &#1588;&#1583;&#1607; &#1575;&#1587;&#1578;. | <a href="video_page.php?id=2309">&#1606;&#1592;&#1585; &#1588;&#1605;&#1575; &#1670;&#1740;&#1607;&#1567;</a>
</div>

</div>

I want parser to parse video_title and the image that associated to that title, and put these into a table. Anybody could show me some sample code to do this?

Upvotes: 1

Views: 1136

Answers (1)

Tim Sullivan
Tim Sullivan

Reputation: 16888

Depending on what you're trying to do, you may find that ElementParser works for you. It provides some very useful methods for getting data out of an HTML document using CSS selectors, similar to jQuery. The documentation is a little light, but an intro to using it is available.

Upvotes: 1

Related Questions