Can webscraper.io scrape JSON data from website head?

Just a quick question (I've similar threads on the subject and tried a few of the suggestions but they don't work)

Can https://webscraper.io/ scrape JSON data from the head section of a page? For example I have a page that includes all the data I need in the head section like this:

 <script type="application/ld+json">
  {
    "@context": "http://schema.org",
    "@graph": [
    {
      "@type": "Car",
      "name": "Peugeot Boxer BlueHDi 335 Professional",
      "brand": {
        "@type": "Brand",
        "name": "Peugeot"
      },
      "manufacturer": "Peugeot",
      "model": "Boxer", 
      "vehicleConfiguration": "BlueHDi 335 Professional",
      "image": "https://f7432d8eadcf865aa9d9-9c672a3a4ecaaacdf2fee3b3e6fd2716.ssl.cf3.rackcdn.com/C1683/U4327/IMG_85189-large.jpg",
      "description": "Brand new build on this low mileage Peugeot Boxer chassis from lightweight polycarbonate panels. DLR lights on Luton top, side ramp entrance for 2 horses rear facing, 3 sliding tinted windows, tie rings, detachable breast bar, led lighting, full size dividing wall adjustable, rubber grip ramp in horse area, vented&hellip;",
      "modelDate": "2019",

@raindrop Yes, that should not be an issue.

You can use a 'Text' selector - script[type="application/ld+json"]:contains("brand") and later isolate the desired data by applying additional data post-processing.

Learn more:

I have done this before a few times with the HTML selector. Then used regex to extract needed text. The previous suggestion to use :contains probably won't work because it is meant for text that will appear on page.

Another tricky thing is to select the correct <script because there may be more than one with the same type="application/ld+json". You can do this with the CSS hierachy or with the :nth selectors, like the examples below.

head script[type="application/ld+json"]
script[type="application/ld+json"]:nth-first-of-type
script[type="application/ld+json"]:nth-of-type(2)

depending on its location.