I'm using Laravel 5.8, Dusk. I would like to find certain elements inside a class.
So let's say I extracted every element on the page with the class of selectable
.
$browser->visit('https://www.website.com')
->script('window.scrollTo(0, 10000);');
$elems = $browser
->pause(1000)
->elements('.selectable');
After this I iterate through these elements like this:
foreach ($elems as $elem) {
}
The question is, how can I find every element with the class of .custom-item
inside these .selectable
classes. Additionally, I'd like to get one of .custom-item
's attribute. I used to get it like this:
$elem->getAttribute('custom-attribute');
(Learned from this Laravel Dusk how to get multiple element's attributes? post)
So how can I find/extract elements inside elements and then get their custom attributes with Laravel Dusk?