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

Expected ',' or '}' after property value in JSON at position 543 (line 23 column 7)

Open mirsella opened this issue 5 months ago • 4 comments

hello !

curl http://localhost:3100/?url=https://www.lonelyplanet.fr/article/croatie-croisiere-entre-dubrovnik-mljet-et-korcula

{"error":1,"message":"Expected ',' or '}' after property value in JSON at position 543 (line 23 column 7)","data":null,"meta":{"service":"article-parser","lang":"javascript","server":"express","platform":"node"}}

The same happen with deno.

thanks !

mirsella avatar Jan 21 '24 14:01 mirsella

same if using extractFromHtml on the body

mirsella avatar Jan 21 '24 14:01 mirsella

@mirsella thank you for your notice. I've checked, the issue relates to extractLdSchema.js.

@andremacola this comes from #374, could you help to fix?

ndaidong avatar Jan 21 '24 15:01 ndaidong

I'll send a fix as soon as I can this week. I took a quick look on my phone and apparently the issue is with the website's own jsonLD. It's poorly formatted, missing a comma in one of the items.

I think we'll need to put in a validator or, to simplify, a try\catch.

andremacola avatar Jan 21 '24 21:01 andremacola

@andremacola thank you, if so I will add a simple try/catch now, please improve it when you are available.

ndaidong avatar Jan 22 '24 04:01 ndaidong