Get part of a child node?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
roasthawg
Forum Newbie
Posts: 5
Joined: Sat Jul 10, 2010 1:55 pm

Get part of a child node?

Post by roasthawg »

So I'm scraping a table from a website and one of the rows looks like this: <td class="name">text1<em>text2</em></td>.

I can't figure out how to get the "text1" into one variable and the "text2" into another. The "text2" is easy enough to extract but the "text1" comes with the "text2" attached to it. I can remove the child but then the "text2" information is lost. Any ideas?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Get part of a child node?

Post by requinix »

Depends how you're extracting all that.

(That's a hint for you to post your code.)
Post Reply