Add JSON extraction embedded in HTML script element#4106
Add JSON extraction embedded in HTML script element#4106hkcomori wants to merge 1 commit intoRSS-Bridge:masterfrom
Conversation
|
sorry i dont understand the use case here maybe show example usage |
|
I want to use JSON dotted path to get information from JSON embedded as a script element, such as the following on this page. <script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"workId":"018d6a5c-b9f2-77db-9191-e7cc6fbfdce2", ... }</script>JSON must be separate from HTML because JSON dotted paths are not HTML readable. |
|
XPathBridge example: Enter web page URL: |
|
Is it better to create bridges to extract RSS from embedded json instead of such format for intermediate files? |
|
Of course, I first tried JsonFormat. {
...
"content": {
"key": "value"
}
}But in fact, the content was converted to a string and raw Json could not be extracted: {
...
"content": "{\"key\": \"value\"}"
}
Yes. I confirmed that this result is raw json content and JSON dotted path can processes it. |
I want to extract JSON embedded in HTML script elements for processing by JSON dotpath.
So I have added a format that outputs only bare content.
Barejsonis a term I coined because pure format names could not explain the behavior..So if you have a better idea, I would like to adopt it.
This format can output only one item, so if more and less than one is found, an error will occur.
This is triggered by the following discussion:
FreshRSS/FreshRSS#6406