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

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39
  1.     
    #1
    Member
    Website's:
    InstantRDP.com

    Smile 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>

    <td nowrap class="odd" align="center">&nbsp;</td>
    <td width="85%" class="even" align="left"><font class="new-row"><a
    href="topic.asp?tid=106110">
    Quality ebay auction</a>&nbsp;</font>
    <font class="sub-row">in General&nbsp;/&nbsp;The Lounge</font><font
    class="sub-row"><br>Started 7/15/2005 - pages <a
    href="topic.asp?tid=106110">1</a> - last posted by <a
    href="profile.asp?action=view&id=Shandy" onmouseover="window.status='Show
    the authors profile'; return true;" onmouseout="window.status=''; return
    true;">Shandy</a></font></td>
    <td width="15%" class="even" valign="middle" align="left"><font
    class="new-row"><a href="profile.asp?action=view&idiscoInferno"
    onmouseover="window.status='Show the authors profile'; return true;"
    onmouseout="window.status=''; return true;">DiscoInf<BR>erno</a></font></td>
    <td nowrap class="odd" valign="middle" align="center"><font
    class="new-row">9</font></td>
    <td nowrap class="odd" valign="middle" align="left">
    <font class="new-row">7/15/2005<br>
    <font class="sub-row">5:02:16 PM</font></font></td>
    </tr>
    ----------------------------------------------------------------------------
    --------------------------------------------

    It's a table which shows the latest posts of a forum. I'd like to pull out
    the following information:
    Topic: Quality ebay auction
    Original poster: DiscoInferno
    Started: 7/15/2005
    Last Post By: Shandy
    Last Post Date: 7/15/2005 5:02:16 PM

    This *type* of information is repeated down the web page although the data will change and I want to do this with the whole page.


    Any suggestions or sample hint codes ?

    Need for C#
    pankaj Reviewed by pankaj 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
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    to be honest i know how to do this with 3 lines of code but im not in the mood to support leaching.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  4.     
    #3
    Member
    Website's:
    InstantRDP.com
    I am not gonna leech. I am developing a application and I'll need to extract some data and display it.




  5.     
    #4
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Download Simple Dom from Source Forge.

    include the file into your application.

    And use this code:

    PHP Code: 
    //Include file here

    //Source
    $source '
    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>
    <td nowrap class="odd" align="center">&nbsp;</td>
    <td width="85%" class="even" align="left"><font class="new-row"><a
    href="topic.asp?tid=106110">
    Quality ebay auction</a>&nbsp;</font>
    <font class="sub-row">in General&nbsp;/&nbsp;The Lounge</font><font
    class="sub-row"><br>Started 7/15/2005 - pages <a
    href="topic.asp?tid=106110">1</a> - last posted by <a
    href="profile.asp?action=view&id=Shandy" onmouseover="window.status='
    Show
    the authors profile
    '; return true;" onmouseout="window.status=''; return
    true;">Shandy</a></font></td>
    <td width="15%" class="even" valign="middle" align="left"><font
    class="new-row"><a href="profile.asp?action=view&idiscoInferno"
    onmouseover="window.status='
    Show the authors profile'; return true;"
    onmouseout="window.status=''; return true;">DiscoInf<BR>erno</a></font></td>
    <td nowrap class="odd" valign="middle" align="center"><font
    class="new-row">9</font></td>
    <td nowrap class="odd" valign="middle" align="left">
    <font class="new-row">7/15/2005<br>
    <font class="sub-row">5:02:16 PM</font></font></td>
    </tr>
    '
    ;

    $html str_get_html($source);

    $topic $html->find('tr td font.new-row a').value();

    //You get the idea..... 
    Peace
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  6.     
    #5
    Member
    Website's:
    InstantRDP.com
    I had already stored the extracted web page in a string.

    I didn't understood what you did with $topic for finding topic.
    Where you specified starting with string and ending with string and extracting the things between both strings ?
    How to use a loop and extract "topic" and then again "topic2" from same page which has another same type of string.

    PHP Code: 
    $topic $html->find('tr td font.new-row a').value(); 
    By the way, I downloaded that and it has php files in it. How to include it ?




  7.     
    #6
    Member
    Website's:
    InstantRDP.com
    Posting new reply so that you can focus on this. I just now saw that I forgot to mention I need it for C#.




  8.     
    #7
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    You would do something like

    PHP Code: 
    $html get_html('http://site.com/topic.asp?id=2'); //Not sure about the function.

    foreach($html->find('table tr') as $tableRow)
    {
        
    //You can now use this like the DOM
        
    $topicLink $tableRow->find('td font.new-row a')->val();

    This is not regex but Dom traversing, such as jQuery inside PHP.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  9.     
    #8
    It begins...
    Edited. Nvm.

  10.     
    #9
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    then i cant help if you need it for C# :/
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  11.     
    #10
    Member
    Website's:
    InstantRDP.com
    Okay, if some knows C#, i need this.

    Some code for extracting xyz.abc from <a tag><c tag>xyz.abc</c></a>
    See in first post what I need to search and how.




Page 1 of 4 123 ... LastLast

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