Browse Source

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

* Improve detection of json

* Update changelog
pull/3534/head^2
Chang-Yen Tseng 9 months ago
committed by GitHub
parent
commit
8227a2d91a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 2
      apps/api/src/services/data-provider/manual/manual.service.ts

6
CHANGELOG.md

@ -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/), 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). 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 ## 2.92.0 - 2024-06-30
### Added ### Added

2
apps/api/src/services/data-provider/manual/manual.service.ts

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

Loading…
Cancel
Save