How to detect the main article tag like Evernote clipper did

前端 未结 1 1505
忘了有多久
忘了有多久 2021-02-01 10:34

When I tried with Evernote clipper extension, I see a very useful feature. When I clicked at \"article\", It gives me a really correct main content of page. Let see the result w

1条回答
  •  北海茫月
    2021-02-01 10:55

    From my knowledge, there is no universal js lib to do that. The Evernote clipper uses its own method to extract the "interesting" content from a web page. You can access the code of the Evernote clipper to try to understand the process.

    On my mac, the path to the chrome extension is :

    ~/Library/Application Support/Google/Chrome/Default/Extensions/pioclpoplcdbaefihamjohnefbikjilc/6.2_0/

    Here's another tool that works pretty much the same : https://www.readability.com/

    You can also check this thread : What algorithm does Readability use for extracting text from URLs?

    or search on google for terms like 'content extraction js lib' for example. (Found this one : https://github.com/hatena/extract-content-javascript)

    Hope this helps

    0 讨论(0)
提交回复
热议问题