await crawler.run(['https://crawlee.dev'], { userData: { depth: 0 } });
userData
to exist, got [object Object]
in object options
userData
in option?userData
as the second parameter of the run()
method instead of within the request. Hence the ArgumentError.await crawler.run([{ url: 'https://crawlee.dev', userData: { depth: 0, }, }]);
const routeHandler = async ({ request, crawler, page, log }) => { // get user data let { depth } = request.userData }