Run JavaScript in safari action

I am using Shortcuts. I was wondering if there is a way to use the Run JavaScript in Safari action to automatically expand all the checkboxes at this URL - https://www.kayak.co.uk/direct

I then wanted to scrape all the data and then use regex to parse it. I’m fine with those steps - just wanted to see if there is a way to expand automatically all the items and extract the expanded data.

You should be able to use something like this to expand all data. Note that this creates a lot of simultaneous connections as the individual flights are fetched using AJAX (might take several seconds/minutes until all data is displayed.)

for (var value of document.querySelectorAll('.airportHeader')) {
  value.click()
}

Thanks for that. Appreciate it.