Skip to content

Commit db7b703

Browse files
authored
ElementHandle docs (#301)
1 parent 9ff3405 commit db7b703

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/PuppeteerSharp/ElementHandle.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99

1010
namespace PuppeteerSharp
1111
{
12+
/// <summary>
13+
/// Inherits from <see cref="JSHandle"/>. It represents an in-page DOM element.
14+
/// ElementHandles can be created by <see cref="Page.QuerySelectorAsync(string)"/> or <see cref="Page.QuerySelectorAllAsync(string)"/>.
15+
/// </summary>
1216
public class ElementHandle : JSHandle
1317
{
1418
internal Page Page { get; }
1519

16-
public ElementHandle(ExecutionContext context, Session client, object remoteObject, Page page) :
20+
internal ElementHandle(ExecutionContext context, Session client, object remoteObject, Page page) :
1721
base(context, client, remoteObject)
1822
{
1923
Page = page;
@@ -202,8 +206,7 @@ public async Task<ElementHandle> QuerySelectorAsync(string selector)
202206
"(element, selector) => element.querySelector(selector)",
203207
this, selector);
204208

205-
var element = handle as ElementHandle;
206-
if (element != null)
209+
if (handle is ElementHandle element)
207210
{
208211
return element;
209212
}

0 commit comments

Comments
 (0)