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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:17:03+00:00 2026-06-05T22:17:03+00:00

This code $html = file_get_html(‘http://runkeeper.com/user/’.RUNKEEPER_ID.’/activity/’); $link1 = $html->find(‘.activityMonth’, 0); will return the FIRST (foo,

  • 0

This code

$html = file_get_html('http://runkeeper.com/user/'.RUNKEEPER_ID.'/activity/');
$link1  = $html->find('.activityMonth', 0);

will return the FIRST (foo, 0) element of a list of activities using Simple HTML DOM.

Here’s the output (content of $link1):

<div class="activityMonth menuItem selected" link="/user/zzvimercm/activity/95648619"><div class="highlight"></div><div class="distanceUnit">km.</div><div class="distance">7.26</div>
<div class="day"><img src="http://d2b4ufapzmnxpw.cloudfront.net/build/3694/static/kronos/images/icon-calendar-17.png" width="24" height="26" border="0" /></div>
<div class="mainText">Running</div> 
</div>

I need to parse the “link” attribute of the first div, and retrieve the activity id (95648619, in this case). I guess that sscanf or Simple HTML DOM itself may do the trick, but I haven’t had success so far.

Any hints?

Thanks in advance

  • 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-05T22:17:05+00:00Added an answer on June 5, 2026 at 10:17 pm

    Example:

    // Get the "link"
    $link = $html->find('div[link]', 0)->link;
    
    // Explode the link, and get the last item
    $activity_id = end(explode('/', $link));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK i have this code HTML: <html> <head> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js> </script> <script type=text/javascript>
So this error is killing me, heres the code: $html = file_get_html('vids.html'); foreach($html->find('a') as
I have this code in a .html.erb file: <script src=http://connect.facebook.net/en_US/all.js#xfbml=1></script> <script> FB.Event.subscribe('edge.create', function(response) {
I pasted the code given in this link to a file called md5.js. http://www.webtoolkit.info/javascript-md5.html
Using this code with simplehtmldom script ( http://simplehtmldom.sourceforge.net/manual.htm ): function file_get_html() { $dom =
http://jvalentino2.tripod.com/dft/index.html My code is really just a copy of the above: package it.vigtig.realtime.fourier; import
I am trying to scrape this web page: http://www.acttab.com.au/interbet/venues?day=today Here is my code: function
How can I get the html source code of http://www.example-webpage.com/file.html without using file_get_contents() ?
I have nav code like this in my HTML file: <div id="center_links"> <ul> <li><a
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now

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.