The Instructions class now returns a path specified in the instructions file.
For example, the response data might contain multiple members within an array. A path can now be specified in the instructions file to target the data of a specific member.
A future PR (WIP: https://github.com/everypolitician/scraper_test/pull/22) will allow the testing of a subset of the response data. In anticipation of that PR, this PR provides a way to specify that subset.
The Instructions class now returns a path specified in the instructions file.
For example, the response data might contain multiple members within an array. A path can now be specified in the instructions file to target the data of a specific member.
Although
Instructions
doesn't care about the value in the:path
field, the path is anticipated to follow the format:key/key=value
.To target Joe, the path would be:
members/id=2
(key/key=value
).The yaml file would be:
The path can be used to drill down any number of levels.
To target Victor Kaminsky's notes, the path would be:
house/upper/members/id=2/notes
.