File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,17 @@ async function extract() {
9191 console . log ( '📌 主标题:' , mainTitle ) ;
9292 let md = `# ${ mainTitle } \n\n` ;
9393
94+ // 获取描述
95+ const descXPath = '//*[@id="__next"]/main/div[1]/div/div[2]/div/div[1]/div[4]/div/div/div[1]/div[2]/div/div[2]/div[1]/div/div[2]' ;
96+ const descEl = getElementByXPath ( descXPath ) ;
97+ if ( descEl ) {
98+ const description = processContent ( descEl ) ;
99+ console . log ( '📝 文章描述:' , description ) ;
100+ if ( description ) {
101+ md += `> ${ description } \n\n` ;
102+ }
103+ }
104+
94105 // 获取大图
95106 const imgXPath = '//*[@id="__next"]/main/div[1]/div/div[2]/div/div[1]/div[4]/div/div/div[1]/div[2]/div/div[2]/div[2]/div/div/div/div/div/div/div/div[1]/div/div/div/img' ;
96107 const img = getElementByXPath ( imgXPath ) ;
You can’t perform that action at this time.
0 commit comments