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 8953093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:01:22+00:00 2026-06-15T14:01:22+00:00

How to Fetch Content in A Div Class using PHP Simple HTML DOM Parser

  • 0

How to Fetch Content in A Div Class using PHP Simple HTML DOM Parser.
Here i want to fetch content from a div class like:

<div class="post" imposition="usermanual">Some Content </div>

So, what is the way to fetch content using this div class post?
I have tried this code but dont works:

$es = $html->find('.post');
$es = $html->find('div.post'); // also try this
$es = $html->find('div[class="post"]'); // also try this

Any idea?

  • 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-15T14:01:23+00:00Added an answer on June 15, 2026 at 2:01 pm

    Under the Magic Attributes tab of How to access the HTML element’s attributes, you’ll find how to access an object’s innertext property. There’s also a plaintext property.

    $es = $html->find('div[class="post"]', 0);
    echo $es->innertext; // Some Content 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My PHP script can fetch content from a div id, but what is the
I'm trying to fetch the content of a div in a html page using
I'm using the threaded comment from http://www.jongales.com/blog/2009/01/27/php-class-for-threaded-comments/ and I have no idea how to
<div id = 'eventcontainer' > <span id = 'class'> <?php //Getting posts from DB
What's good method to fetch related content in php. i have $keyword, if i
while($DNB->fetch()){ ?> var infowindow = new google.maps.InfoWindow({content: <?php echo $businessname ?>}); var point =
I'm using PHP's function file_get_contents() to fetch contents of a URL and then I
I fetch all tables from a database using tables = Utility.DBConnection.GetSchema(Tables, restrictions); How do
I got the following very basic template: <html> <head> </head> <body> <div> <!-- Using
Using pagination, I have a div structure like so in the first page: <div

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.