The problem is retrieving and displaying the div contents. Catch is, it's with a multiclass:
<li class="activity user-generated" id="activity:153411947-kIq0nOFam0hE68sL6P298_DIo4s-1386284074745">
I probably could've worked with it easier if the ID doesn't automatically generate for each new status, in my case.
Also, on this topic, is it possible to get each tag and list them in order?
Thanks for your time.
$classname = "activity";
$domdocument = new DOMDocument();
$domdocument->loadHTML($doc);
$a = new DOMXPath($domdocument);
$spans = $a->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' $classname ')]");
with $doc being the page I'm loading
Alright, let me restart this, since the fact this isn't working is bugging me greatly.
What I'm trying to do is read from the element I've posted, but I need to call it from a URL, as reading just the element itself as HTML is fine. From a URL, I get a bunch of unnecessary errors, basically repeating the same thing.
Function obtainUserStatus($Username){
$DOM = new DOMDocument();
$Class = "activity";
$DOM->loadHTMLFile('http://lifestream.aol.com/stream/' . $Username);
$X = new DOMXPath($DOM);
$ID = $X->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' $Class ')]")->item(0)->getAttribute('id');
Echo $ID;
}
Which just returns the errors.
I need to return the div's content from the class (or the ID, which I'm doing from there -- no big deal.)