mardi 7 mai 2019

Laravel Dusk: How to get HTML from element?

I understand that you can get the text from an element, like this:

$text = $browser->text('.selector');

My question is: How can you get the raw HTML content? E.g. the following doesn't work

$text = $browser->html('.selector');

E.g. if the element is:

<div class='selector'><p>Hello</p></div>

I'd like to get the following as the output (with the < p> tags):

<p>Hello</p>

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire