Results 1 to 10 of 39
-
3rd Jul 2010, 12:43 PM #1OPMemberWebsite's:
InstantRDP.comExtracting 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"> </td>
<td nowrap class="odd" align="center"> </td>
<td width="85%" class="even" align="left"><font class="new-row"><a
href="topic.asp?tid=106110">
Quality ebay auction</a> </font>
<font class="sub-row">in General / 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"> </td> Rating: 5
-
3rd Jul 2010, 01:13 PM #2MemberWebsite's:
litewarez.net litewarez.com triniwarez.comto 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
-
3rd Jul 2010, 01:41 PM #3OPMemberWebsite's:
InstantRDP.com
-
3rd Jul 2010, 01:55 PM #4MemberWebsite's:
litewarez.net litewarez.com triniwarez.comDownload 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"> </td>
<td nowrap class="odd" align="center"> </td>
<td width="85%" class="even" align="left"><font class="new-row"><a
href="topic.asp?tid=106110">
Quality ebay auction</a> </font>
<font class="sub-row">in General / 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.....
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
-
3rd Jul 2010, 02:13 PM #5OPMemberWebsite's:
InstantRDP.comI 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();
-
3rd Jul 2010, 02:19 PM #6OPMemberWebsite's:
InstantRDP.com
-
3rd Jul 2010, 02:20 PM #7MemberWebsite's:
litewarez.net litewarez.com triniwarez.comYou 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();
}
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
-
3rd Jul 2010, 02:20 PM #8It begins...
Edited. Nvm.
-
3rd Jul 2010, 02:20 PM #9MemberWebsite's:
litewarez.net litewarez.com triniwarez.comthen 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
-
3rd Jul 2010, 02:26 PM #10OPMemberWebsite's:
InstantRDP.com
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
extracting data from diffrent site
By zebono2 in forum Web Development AreaReplies: 1Last Post: 28th Jul 2012, 06:22 AM -
C++ string search help needed
By googleplus in forum Web Development AreaReplies: 0Last Post: 12th May 2012, 04:42 PM -
How to recover deleted or lost data, file, photo on Mac with Data Recovery software
By Jack20126 in forum General DiscussionReplies: 0Last Post: 20th Dec 2011, 03:37 AM -
php string - heredoc syntax
By desiboy in forum Web Development AreaReplies: 3Last Post: 16th Nov 2010, 05:15 PM -
[c#] Get String In between strings
By jayfella in forum Web Development AreaReplies: 3Last Post: 16th Jun 2010, 11:23 PM
themaPoster - post to forums and...
Version 5.22 released. Open older version (or...