Reputation: 3052
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">۱۵ مرداد ۱۳۹۱ (<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>تا الان ۱۴ نظر در مورد این ویدیو داده شده است. | <a href="video_page.php?id=2309">نظر شما چیه؟</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
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