Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
We are shipping Puppeteer Sharp v0.7 with many cool new features: Element selectors and evaluation over elements. But our big challenge on v0.7 was one of the hard things in computer science: Naming Things.
Puppeteer has these 5 cool functions:
$(selector): It calls
document.querySelectorand returns an
$$(selector): It calls
document.querySelectorAlland returns an
$eval(selector, function): It calls
document.querySelectorand executes a function passing the element as an argument.
$$eval(selector, function): It calls
document.querySelectorAlland executes a function passing the element array as an argument.
$x(xpathExpression): It calls
document.evaluateand returns an
What do all these methods have in common? Hint: You can solve this using a
Yes, you guessed it right! They all have that
$ symbol. And guess what? exactly, we can't name a method
$ in C#.
So, in order to give these functions a clear and "csharpy" name, we decided to call them in this way:
These methods may be more verbose, but this naming convention makes them clearer and hopefully, easier to learn.
This is the complete list of new APIs we implemented in this version: