function getOrigin($: typeof cheerioModule) { let origin = "" const specElements = $('#product_specs table tr').toArray() for (const spec of specElements) { const _$ = cheerioModule.load(spec) const specTitle = _$(".attrib").text().trim() if(specTitle.includes("제조국")){ origin = _$(".attrib-val").text().trim() break } } return origin }
load()
. Instead of doing this:const _$ = cheerioModule.load(spec);
$
already provided to you by Crawlee:const elem = $(spec);
spec
element. 😄