Node.js learning diary 10

1.Dialog class method of
parsing: Dialog objects distributed via the page 'dialog' event.
[. 1] dialog.accept ([promptText])
[2] dialog.defaultValue ()
[. 3] dialog.dismiss ()
[. 4] dialog.message ()
[. 5] dialog.type ()

2.ConsoleMessage class method of
parsing: ConsoleMessage objects distributed via the page 'console' event.
[. 1] consoleMessage.args ()
[2] consoleMessage.text ()
[. 3] consoleMessage.type ()

3.Frame Class
Analysis: at each time point, the page by page.mainFrame () and frame.childFrames () method of exposing details of the current frame. Frame object life cycle is controlled by three events, they monitor objects by page:
[1] 'frameattached': Triggered when the frame is the page loads. A framework will only be loaded once.
[2] 'framenavigated': When the frame changes triggered URL.
[3] 'framedetached': triggered when a page frame is separated. A framework will only be separated again.

4.ExecutionContext Class
Analysis: This class represents a JavaScript execution context. There are many possible execution contexts Page:
[1] Each frame has a "default" execution context, it is always in the frame to create additional DOM after. The context returned by frame.executionContext () method.
[2] Extensions of the contents of the script to create other execution context.
Description: In addition to the page, the execution context can be found in workers in.
[. 1] executionContext.evaluate (PageFunction, args ...)
[2] executionContext.evaluateHandle (PageFunction, args ...)
[. 3] executionContext.frame ()
[. 4] executionContext.queryObjects (prototypeHandle)

5.JSHandle class method of
parsing: JSHandle The JavaScript object within the page. JSHandles can be created using page.evaluateHandle method.
[. 1] jsHandle.asElement ()
[2] jsHandle.dispose ()
[. 3] jsHandle.executionContext ()
[. 4] jsHandle.getProperties ()
[. 5] jsHandle.getProperty (propertyName)
[. 6] jsHandle.jsonValue ()

6.ElementHandle class
analytic: ElementHandle represent DOM elements within a page. ElementHandles can page.$create methods. ElementHandle class inherits from JSHandle.

7.Request Class
Analysis: whenever a page sends a request, such as a network request, the following events are triggered puppeteer page:
[. 1] 'Request' page when the request to initiate the trigger event.
[2] 'response' in response to a request received when triggered.
[3] 'requestfinished' trigger and in response requests the completion of the download is complete body
if the request fails some point, will not trigger a subsequent 'requestfinished' events [may not trigger the 'response' event], but the trigger 'requestfailed' event. If the request is in response to a redirection request will successfully trigger 'requestfinished' event, and initiate a new request for redirection url.

8.Response class
Analytical: Response class represents the response page received.

Method 9.SecurityDetails class
Analytical: SecurityDetails class showing details safety when the response is received via a secure connection.
[. 1] securityDetails.issuer ()
[2] securityDetails.protocol ()
[. 3] securityDetails.subjectName ()
[. 4] securityDetails.validFrom ()
[. 5] securityDetails.validTo ()

10.Target类的方法
解析:
[1]target.browser()
[2]target.browserContext()
[3]target.createCDPSession()
[4]target.opener()
[5]target.page()
[6]target.type()
[7]target.url()

Method 11.CDPSession class
Analytical: CDPSession examples of the native communications protocol ChromeDevtools:
[1] A method can be used session.send protocol method calls.
[2] protocol events can subscribe by session.on method.
[. 1] cdpSession.detach ()
[2] cdpSession.send (Method [, the params])

12.Coverage class method of
parsing: JavaScript and CSS information used part of the relevant page of Coverage collected.
[. 1] coverage.startCSSCoverage (Options)
[2] coverage.startJSCoverage (Options)
[. 3] coverage.stopCSSCoverage ()
[. 4] coverage.stopJSCoverage ()

13.TimeoutError Class
Analysis: Whenever certain operations terminate because of a timeout is triggered TimeoutError. E.g. page.waitForSelector (selector [, options]) or puppeteer.launch ([options]).

References:
[. 1] Puppeteer: HTTPS: //zhaoqize.github.io/puppeteer-api-zh_CN/

Published 364 original articles · won praise 422 · views 360 000 +

Guess you like

Origin blog.csdn.net/shengshengwang/article/details/103951389