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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:51:16+00:00 2026-06-09T07:51:16+00:00

I want to get some data from some html pages that I have and

  • 0

I want to get some data from some html pages that I have and then store the data in the database.

The HTML file has a list of blogs and they are organized like this:

 <div class="breadlist"></div>    

    <h3 class="list"><a href="http://test1.com">Title 1</a></h3>
    <p><strong>Description:</strong> Description 1.<br>
    <strong>Author:</strong> Author1<br>
    <strong>XML:</strong> <a href="http://test1.com/feed">Title 1</a><br>
    <strong>Language:</strong> Language1</p>

    <h3 class="list"><a href="http://test2.com">Title 2</a></h3>
    <p><strong>Description:</strong>Description 2. <br>
    <strong>Author:</strong> Author1<br>
    <strong>XML:</strong> <a href="http://test2.com/feed">Title 2</a>  
    <strong>Language:</strong> Español</p>

<div class="breadlist"></div>

In this example, there are 2 blogs, but sometimes there are 10 or even 100 blogs. Every file has a different amount. I would like to get this data:

Website Address, Title, Description, Author, Feed, Language.

I was trying to do it with PHP Simple HTML DOM Parser, but today is the first time I was trying and couldn’t get anywhere. I imagine I have to loop something but don’t know how to do it. Anybody have any idea how to do it with PHP? Thanks!

—-EDIT—-
This is what I’ve tried so far:

$str = <<<HTML
<div class="breadlist"></div>    

    <h3 class="list"><a href="http://test1.com">Title 1</a></h3>
    <p><strong>Description:</strong> Description 1.<br>
    <strong>Author:</strong> Author1<br>
    <strong>XML:</strong> <a href="http://test1.com/feed">Title 1</a><br>
    <strong>Language:</strong> Language1</p>

    <h3 class="list"><a href="http://test2.com">Title 2</a></h3>
    <p><strong>Description:</strong>Description 2. <br>
    <strong>Author:</strong> Author1<br>
    <strong>XML:</strong> <a href="http://test2.com/feed">Title 2</a>  
    <strong>Language:</strong> Español</p>

<div class="breadlist"></div>
HTML;

$html = str_get_html($str);
    foreach($html->find('h3[class=list]') as $title){
       echo "Title: " . $title->innertext . "<br />";
    }
    foreach($html->find('h3[class=list] a') as $address){
       echo "Address: " . $address->href . "<br />";       
}
 foreach($html->find('p') as $description){

       echo "Description: " . $description->childNodes(3)->plaintext . "<br />"; //doesnt work
 }
 foreach($html->find('p a') as $feed){
       echo "Feed: " . $feed->href . "<br />";       
}
 foreach($html->find('h3[class=list] a') as $language){
       echo "Language: " . $language->innertext . "<br />"; // doesnt work       
}
  • 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-09T07:51:18+00:00Added an answer on June 9, 2026 at 7:51 am

    I couldn’t find a way to do it so I just did a find, replace and modify it in a way that could use the PHP Simple HTML DOM Parser

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one problem , I want to get some data from XML file
I get some data from an PHP-Script via AJAX and want to have the
I want to get some data from html tags in a web page. For
I have some javascript that displays some data from my database on my webpage.
I am using http://lite.facebook.com And i want to get some data from my account.
so I have multiple HTML files which I need to get some praticular data
I want to make a page that displays some data from a DB, so
I have a data Store that gets it's information from a JSON api on
The project I'm working on has some data that needs to get passed to
So I have a PHP backend that pulls some data from SQL, let's just

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.