article_spider
article_spider copied to clipboard
error TS2339: Property 'attribs' does not exist on type 'Element'.
article_spider % tsc src/wechat/parser.ts:207:29 - error TS2339: Property 'attribs' does not exist on type 'Element'. Property 'attribs' does not exist on type 'TextElement'.
207 const src = img.attribs['data-src'] || img.attribs['data-backsrc'] || img.attribs['src']; ~~~~~~~
src/wechat/parser.ts:207:56 - error TS2339: Property 'attribs' does not exist on type 'Element'. Property 'attribs' does not exist on type 'TextElement'.
207 const src = img.attribs['data-src'] || img.attribs['data-backsrc'] || img.attribs['src']; ~~~~~~~
src/wechat/parser.ts:207:87 - error TS2339: Property 'attribs' does not exist on type 'Element'. Property 'attribs' does not exist on type 'TextElement'.
207 const src = img.attribs['data-src'] || img.attribs['data-backsrc'] || img.attribs['src']; ~~~~~~~
src/wechat/parser.ts:208:30 - error TS2339: Property 'attribs' does not exist on type 'Element'. Property 'attribs' does not exist on type 'TextElement'.
208 const type = img.attribs['data-type'] || 'jpg'; ~~~~~~~
src/wechat/parser.ts:213:38 - error TS2339: Property 'attribs' does not exist on type 'Element'. Property 'attribs' does not exist on type 'TextElement'.
213 imagesMeta.push({ ...img.attribs }); ~~~~~~~
src/wechat/parser.ts:229:28 - error TS2339: Property 'tagName' does not exist on type 'TextElement | TagElement | CommentElement'. Property 'tagName' does not exist on type 'TextElement'.
229 img.parent.tagName === 'p' && (contentElement.find('p')[0] === img.parent)) { ~~~~~~~
typings/crawler.d.ts:9:16 - error TS2304: Cannot find name 'CheerioAPI'.
9 $: CheerioAPI; ~~~~~~~~~~
Found 7 errors.
我也遇到了,正好7个错误