Get title using puppeteer

Puppeteer is very useful and I have been able to scrape many different parts of my site. I know its very easy easy to get by selection and xpath but how would I get by xpath or selection and print out "hey"

<div title="hey">spoon</div>

here is what I have come up with so far.

 let hey = document.querySelector(myPath).innerText;

This result returns "Spoon" How would I get "Hey"

Read more here:

Content Attribution

This content was originally published by Frank Ford at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: