1

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?

4
  • stackoverflow.com/questions/8674342/… Commented Aug 6, 2012 at 0:08
  • 2
    A quick search for "parse html objective-c" shows dozens of relevant questions. Commented Aug 6, 2012 at 0:09
  • @Tim possible duplicate, yes. But the accepted answer on that question is waaaaaay too complicated. A simple NSXMLParser will suffice. Commented Aug 6, 2012 at 0:11
  • Should I exchange HTML to XML? if yes, how? Commented Aug 6, 2012 at 0:17

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.