Reputation: 584
Above is my DOM and I expect to get 4 hour ago but I got an error
Fatal error: Call to a member function find() on a non-object
My php look like this
$time_ago = $html->find('.entry .unvoted',0)->find('.tagline .live-timestamp',0)->plaintext;
echo $time_ago;
I know I could do with one find(), which will be find('tagline .live-timestamp')
but I wonder why double find() doesn't work.
Upvotes: 3
Views: 109
Reputation: 584
I got it work by this
$time_ago = $go->find('.entry',0)->find('.tagline .live-timestamp',0)->plaintext;
because there's more than one class called unvoted
Upvotes: 0