article-extractor icon indicating copy to clipboard operation
article-extractor copied to clipboard

Unable to use this library on react-native

Open eeshankeni opened this issue 1 year ago • 2 comments

This is the error I get while using the extract function.

"Error: ENOENT: no such file or directory, open 'S:\tmp\hermes\staging\hermes\cmake\intlDebug\arm64-v8a\lib\InternalBytecode\InternalBytecode.js"

Initially, my app wouldn't even open as it couldn't find the 'html-crush' index file. So I moved the index.d.ts file from the types folder and into the root of the html-crush package folder and renamed it to index.ts, the app then started working.

I only care about the image attribute so is there any alternative to get that?

eeshankeni avatar Aug 09 '22 13:08 eeshankeni

@eeshankeni hello, great that you made it work! I'm not familiar with TypeScript environment and no idea about the error InternalBytecode.js you got at first.

By default, article-parser is only looking to detect the main image from meta tags. If the website does not follow SEO standard, you may need to use DOM selector to find the best image from extracted content. Maybe the first one, or the largest one.

ndaidong avatar Aug 09 '22 16:08 ndaidong

Resorted to using https://github.com/spykesocial/react-native-opengraph-scrapper in case anyone has this same issue in the future.

eeshankeni avatar Aug 09 '22 23:08 eeshankeni