Activity Stream
48,167 MEMBERS
63940 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 39

Hybrid View

pankaj Extracting data from a string 3rd Jul 2010, 12:43 PM
litewarez to be honest i know how to do this... 3rd Jul 2010, 01:13 PM
pankaj I am not gonna leech. I am... 3rd Jul 2010, 01:41 PM
litewarez Download Simple Dom... 3rd Jul 2010, 01:55 PM
pankaj I had already stored the extracted... 3rd Jul 2010, 02:13 PM
pankaj Posting new reply so that you can... 3rd Jul 2010, 02:19 PM
litewarez You would do something like ... 3rd Jul 2010, 02:20 PM
Lifetalk Edited. Nvm. 3rd Jul 2010, 02:20 PM
litewarez then i cant help if you need it for... 3rd Jul 2010, 02:20 PM
pankaj Okay, if some knows C#, i need... 3rd Jul 2010, 02:26 PM
rohansakhale try using some logic where the... 4th Jul 2010, 06:24 AM
Dman I think regex should do the trick 4th Jul 2010, 08:50 AM
pankaj Yeah, thanks Dman. It helped out. 4th Jul 2010, 11:06 AM
Jueki It's relatively simple actually.... 4th Jul 2010, 11:23 AM
Hyperz Never use regex for parsing markup.... 4th Jul 2010, 02:22 PM
Dman I beg to differ - regex is much... 5th Jul 2010, 03:36 PM
pankaj Where to put this file -... 4th Jul 2010, 03:27 PM
Hyperz Can't find what files? You only... 4th Jul 2010, 03:36 PM
Hyperz Cleaner? That sounds like something... 5th Jul 2010, 03:53 PM
Dman Using a DOM parser is faster than... 5th Jul 2010, 04:00 PM
Hyperz No, using regex is overkill. I... 5th Jul 2010, 04:06 PM
Dman I know how regex works. The way DOM... 5th Jul 2010, 05:24 PM
Hyperz I don't think you do. If you did... 5th Jul 2010, 06:09 PM
Dman Well from the looks of it, it... 6th Jul 2010, 09:47 AM
Hyperz ^That too is how it should not be... 6th Jul 2010, 12:11 PM
pankaj I am not doing by Hyper'z method or... 6th Jul 2010, 10:55 AM
pankaj I already completed coding the part... 6th Jul 2010, 12:22 PM
Hyperz What is there to learn about: ... 6th Jul 2010, 12:41 PM
jayfella Doing what pankaj wants is quickest... 6th Jul 2010, 12:47 PM
Hyperz But it is not reliable with dynamic... 6th Jul 2010, 12:51 PM
jayfella k gimme half an hour and ill show 2... 6th Jul 2010, 12:52 PM
Hyperz I know the idea behind IndexOf and... 6th Jul 2010, 12:55 PM
pankaj I am sure nothing would crash or... 6th Jul 2010, 12:56 PM
Hyperz Just extract the .dll and add a... 6th Jul 2010, 01:00 PM
pankaj And can ya replace my above code... 6th Jul 2010, 01:05 PM
pankaj Getting error like.... 6th Jul 2010, 01:13 PM
Hyperz It would help if your code made... 6th Jul 2010, 01:15 PM
pankaj I didn't understand. I tried few... 6th Jul 2010, 01:24 PM
Hyperz I honestly give up trying to... 6th Jul 2010, 01:38 PM
Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Respected Developer
    Never use regex for parsing markup. Download SharpLeech and add a reference to the Engine dll in your project. Then add these using's in your code:

    PHP Code: 
    using Hyperz.SharpLeech.Engine.Html;
    using Hyperz.SharpLeech.Engine.Net
    Now you can use it like:
    PHP Code: 
    var html = new HtmlDocument();

    // load the html
    html.LoadHtml("<div class=\"example\">foo</div>");

    // use XPath to select the div
    var node html.DocumentNode.SelectSingleNode("//div[@class='example']");
    var 
    divContent HttpUtility.HtmlDecode(node.InnerText); 
    XPath info: http://www.w3schools.com/xpath/default.asp
    Hyperz Reviewed by Hyperz on . Extracting data from a string I've extract this from a webpage and stored in a string. ---------------------------------------------------------------------------- ---------------------- <tr height="25"> <td nowrap class="odd" align="center"><img src="/forums/images/icon_topic_new.gif" width=14 height=14 alt='New Topic' border=0></td> <td nowrap class="odd" align="center">&nbsp;</td> Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    Website's:
    PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.org
    Quote Originally Posted by Hyperz View Post
    Never use regex for parsing markup. Download SharpLeech and add a reference to the Engine dll in your project. Then add these using's in your code:

    PHP Code: 
    using Hyperz.SharpLeech.Engine.Html;
    using Hyperz.SharpLeech.Engine.Net
    Now you can use it like:
    PHP Code: 
    var html = new HtmlDocument();

    // load the html
    html.LoadHtml("<div class=\"example\">foo</div>");

    // use XPath to select the div
    var node html.DocumentNode.SelectSingleNode("//div[@class='example']");
    var 
    divContent HttpUtility.HtmlDecode(node.InnerText); 
    XPath info: http://www.w3schools.com/xpath/default.asp
    I beg to differ - regex is much cleaner lol

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. extracting data from diffrent site
    By zebono2 in forum Web Development Area
    Replies: 1
    Last Post: 28th Jul 2012, 06:22 AM
  2. C++ string search help needed
    By googleplus in forum Web Development Area
    Replies: 0
    Last Post: 12th May 2012, 04:42 PM
  3. Replies: 0
    Last Post: 20th Dec 2011, 03:37 AM
  4. php string - heredoc syntax
    By desiboy in forum Web Development Area
    Replies: 3
    Last Post: 16th Nov 2010, 05:15 PM
  5. [c#] Get String In between strings
    By jayfella in forum Web Development Area
    Replies: 3
    Last Post: 16th Jun 2010, 11:23 PM

Tags for this Thread

BE SOCIAL