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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:11:02+00:00 2026-06-09T11:11:02+00:00

I want to get remote html contents that on li that with a spacific

  • 0

I want to get remote html contents that on “li” that with a spacific Class name and Children of em using divs.

My remote content is Like this

<ul>

<li class=”user”>

<div class=”name”>My Name 1</div>

<div class=”rep”>20</div>

</li>

<li class=”user”>

<div class=”name”>My Name 2</div>

<div class=”rep”>23</div>

</li>

<li class=”user”>

<div class=”name”>My Name 3</div>

<div class=”rep”>40</div>

</li>

</ul>

After get their data it must be like this.

[My Name 1,20]

[My Name 2,23]

[My Name 3,40]

Thanks.

Sorry for the My Poor English

Note : Have more content than this on remote page.

  • 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-09T11:11:03+00:00Added an answer on June 9, 2026 at 11:11 am

    Use CURL to read the remote URL to fetch the HTML.

    $url = "http://www.example.com";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
    $output = curl_exec($curl);
    curl_close($curl);
    

    Then use PHP’s DOM object model to parse the HTML.

    For example to fetch all <h1> tags from the source,

    $DOM = new DOMDocument;
    $DOM->loadHTML( $output);
    
    //get all H1
    $items = $DOM->getElementsByTagName('h1');
    
    //display all H1 text
     for ($i = 0; $i < $items->length; $i++)
            echo $items->item($i)->nodeValue . "<br/>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get a page using file_get_contents from a remote server, but I want to
I am displaying a webview with a remote html content get as a string
Let's assume i have HTML markup like this: <body> <div id=content> <div id=sidebar> </div>
I am using the below to get all of the html content of a
I just want to quickly store an array which I get from a remote
Just want to ask can netbean IDE get connected to clearcase remote client server
I want get all of the Geom objects that are related to a certain
I am have buttons like this: <button type=button class=img img_button_bla onclick=...>Bla!</button> The img class
For class we have to work on a remote server that the school hosts.
I have a page that is written in HTML, I want to add a

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.