I'm able to get anchor's property href using PHP Simple HTML DOM Parser by using following code
foreach($page->find('a') as $anchor){
echo trim(strip_tags($anchor->href));
}
This is working absolutely fine.
But Here is the issue, Now I've to get the data-cursor property of div
<div class = 'someClass' data-cursor = '4515314844'>
some contents here..
</div>
but if I try the same approach, as mentioned above, this throws an error
foreach($page->find('div') as $div){
echo trim(strip_tags($div->data-cursor));
}
Error: Use of undefined constant cursor - assumed 'cursor'
Thanks.