code: def write_pa11y_config(item):
      
      config = {
          "page": {
              "headers": item["request_headers"],
          },
      }
      config_file = tempfile.NamedTemporaryFile(
          mode="w",
          prefix="pa11y-config-",
          suffix=".json",
          delete=False
      )
      json.dump(config, config_file)
      config_file.close()
      return config_file
docs: The only way that pa11y will see the same page that scrapy sees
      is to make sure that pa11y requests the page with the same headers.
      However, the only way to configure request headers with pa11y is to
      write them into a config file.
  
      This function will create a config file, write the config into it,
      and return a reference to that file.