page.on('console') event.
Overview
Methods
type()
Get the type of the console message. Returns:string
Possible values:
'log''debug''info''error''warning''dir''dirxml''table''trace''clear''startGroup''startGroupCollapsed''endGroup''assert''profile''profileEnd''count''timeEnd'
text()
Get the text of the console message. Returns:string
args()
Get the list of arguments passed to the console method. Returns:JSHandle[]
Each argument is represented as a JSHandle that can be evaluated:
location()
Get the location in the source code where the console method was called. Returns:{ url: string, lineNumber: number, columnNumber: number }
string
URL of the script where console was called
number
Line number in the script (0-based)
number
Column number in the script (0-based)
timestamp()
Get the timestamp when the message was logged. Returns:number
Timestamp in milliseconds since Unix epoch:
page()
Get the page that emitted the console message. Returns:Page | null
Returns null if the message came from a worker:
worker()
Get the worker that emitted the console message. Returns:Worker | null
Returns null if the message came from a page:
