Hi I am trying to get Inner Elements using chrome console, but it throwing me an error , Here is my code snippet . Any Workaround will really help me to get elements and automate it. I have attached a screenshot of a common website
When I do this I am getting the list of class element(i.e.swatches-wrap) as an Array.
$$(`.swatches-wrap`);
When I try this its throwing me an error Uncaught TypeError: $$(...)[0].$ is not a function
$$(`.swatches-wrap`)[0].$(`.title`);
$(".swatches-wrap")[0].querySelector(".info")
returns first found element
returns null
if not found
you can chain it as well unless it is null
:
$(".swatches-wrap")[0].querySelector(".info").querySelector(".something")