I am using scrapy to get the integer values for the field10 and field12 for a given ID within the following script :
<script>
Autoslave.jQuery(function ($) {
"use strict";
var map = initMap([
{"field1": "operational",
"field2": "operational",
"field3": "operational",
"ID": 2,
"field4": "some text",
"field5": 48.8732135,
"field6": 2.3903853,
"field7": 1,
"field8": "SPACE",
"field9": "some text",
"field10": 4,
"field10": false,
"field12": 0},
{"field1": "operational",
"field2": "operational",
"field3": "operational",
"ID": 3,
"field4": "some text",
"field5": 48.8592806,
"field6": 2.3773563,
"field7": 0,
"field8": "SPACE",
"field9": "some text",
"field10": 2,
"field11": false,
"field12": 3},
...
</script>
In scrapy shell, I've succeed to get the script text with response.xpath('//script[14]/text()').extract()but then I don't know how to select my values within the text, for a defined ID. Any ideas how to this (maybe using regex ?)
ID, let's say2here, I want to get the linked"field10"and/or"field12"values, which are4and0in this case