File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
src/content-script/site-adapters/juejin Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -3,22 +3,14 @@ import { cropText } from '../../../utils'
33export default {
44 inputQuery : async ( ) => {
55 try {
6- const title = document . querySelector (
7- '#juejin > div.view-container > main > div > div.main-area.article-area > article > h1' ,
8- ) ?. textContent
9- const description = document . querySelector (
10- '#juejin > div.view-container > main > div > div.main-area.article-area > article > div.article-content' ,
11- ) ?. textContent
6+ const title = document . querySelector ( '#juejin .article-title' ) ?. innerText
7+ const description = document . querySelector ( '#juejin #article-root' ) ?. innerText
128 if ( title && description ) {
13- const author = document . querySelector (
14- '#juejin > div.view-container > main > div > div.main-area.article-area > article > div.author-info-block > div > div.author-name > a > span.name' ,
15- ) ?. textContent
16- const comments = document . querySelectorAll (
17- 'div.content-box > div.comment-main > div.content' ,
18- )
9+ const author = document . querySelector ( '#juejin .author-block .info-box span' ) ?. innerText
10+ const comments = document . querySelectorAll ( '.comment-list .comment-content' )
1911 let comment = ''
2012 for ( let i = 1 ; i <= comments . length && i <= 4 ; i ++ ) {
21- comment += `answer${ i } : ${ comment [ i - 1 ] . textContent } |`
13+ comment += `answer${ i } : ${ comment [ i - 1 ] . innerText } |`
2214 }
2315 return await cropText (
2416 `You are an expert content analyst and summarizer. ` +
You can’t perform that action at this time.
0 commit comments