I have the following example
<div >
<div>
<div>
<p>1</p>
</div>
</div>
<p>2</p>
<div>
</div>
<p>3</p>
</div>
How can I extract the 3 p tags using goquery or CSS selectors (or both) Maybe in this case the selector would be "div.myClass"
CodePudding user response:
You can select all child elements of .myClass
with a selector like this:
.myClass p {
/* Selects all p elements that descend from .myClass */
}
A guide about descendant selectors can be found here.