Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8597735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:58:48+00:00 2026-06-12T00:58:48+00:00

I have a problem parsing with PHP Simple HTML DOM -lib. HTML: <td> <span>text</span>

  • 0

I have a problem parsing with PHP Simple HTML DOM -lib.

HTML:

<td>
<span>text</span>
actual text i want to pick up
<span>text2</span>
</td>

I dont know how to get the “actual text i want to pick up” -part from that.
$node->innertext and $node->plaintext have the text inside the span-tags aswell.

edit:
I have tried

$node->innertext // prints the whole thing
$node->plaintext // prints "textactual text i want to pick uptext"
$node->tag //prints td

The manual doesnt seem to give any clear mention for a case like mine.

If there is a better way to parse html than that library, I am open to other suggestions aswell. I have mostly gotten what I want with that library, but this text I havent been able to pick up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:58:49+00:00Added an answer on June 12, 2026 at 12:58 am

    Ok, I figured how to access the needed information. Tried different combinations about $node->children($x)->innertext, but that didnt help. This way doesnt feel “right”, but works in my case.

    foreach($node->nodes as $c) {
       if($c->tag == "text")
         $text = $c->innertext;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just a PHP script for HTML parsing and it works on simple
I have a problem with passing variables as reference in PHP. I want to
I have this strange problem parsing XML document in PHP loaded via cURL. I
HI, I have a problem parsing a date in php using strptime() as my
I don't have any problem parsing WebView HTML or loading URLs (relative or absolute)
I have a problem parsing a XML file which contains special characters like ,
I have one problem with parsing *.docx document with OpenXML (C#). So, here's my
Ok, I have a very frustrating problem. I am parsing a webpage and need
I have problem with passing an argument to my simple function in jQuery: When
I have a problem with my php XML generator class; I used XML Creator

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.