Feature/improve detection of json used via scraper configuration (#3539)

* Improve detection of json

* Update changelog
This commit is contained in:
Chang-Yen Tseng 2024-07-03 09:16:07 -07:00 committed by GitHub
parent 194aee97db
commit 8227a2d91a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Improved the detection of REST APIs (`JSON`) used via the scraper configuration
## 2.92.0 - 2024-06-30
### Added

View File

@ -257,7 +257,7 @@ export class ManualService implements DataProviderInterface {
signal: abortController.signal
});
if (headers['content-type'] === 'application/json') {
if (headers['content-type'].includes('application/json')) {
const data = JSON.parse(body);
const value = String(
jsonpath.query(data, scraperConfiguration.selector)[0]