Search the easyJet flight booking flow for a one-way flight from {origin} to {destination} on {date}, wait for the results page to load, extract visible result information, and optionally capture a screenshot.
Use Cases
Use for one-way flight searches on easyJet when the caller supplies IATA airport codes and a travel date. Supply the date as YYYY-MM-DD and convert it to the calendar button format used by the site.
Automation Flow
- Navigate directly to
https://www.easyjet.com/en, where the booking form is available. - In the same browser interaction sequence, dismiss the cookie banner if present with
button#ensRejectAds. - If the form has a preselected or stale date, clear it with
button[data-testid='clear-button']. - Fill
input#fromwith{origin}and select the matching autocomplete optioninput#{origin}_from_option. - Fill
input#towith{destination}and selectinput#{destination}_to_option. - Open the date picker with
input#when. Once it is open, ifbutton[data-testid='toggle']hasaria-checked="true"(return trip), click it once to switch to one way; confirminput#whenends withOne way. Select the date button whose test ID isD-M-YYYY(for example,button[data-testid='4-12-2026']for2026-12-04). Close the picker withbutton[data-testid='close-button']if it remains open. - Submit with
button[data-testid='submit'], wait for navigation, and wait for the results page to render. - If easyJet presents PerimeterX protection, solve it with the browser automation provider's perimeterx challenge handler and wait for completion. If protection appears again after a modal or during result settling, solve it again before continuing.
- If
dialog#welcomeModalappears after verification, dismiss or confirm it usingbutton[data-cy='welcome-modal__button--confirm']or the modal's primary button, then allow the results UI to settle. - Run this extractor on the loaded results page, then take the requested screenshot only after the results page and any required modal/challenge have finished loading:
(() => {
const clean = s => (s || '').replace(/\s+/g, ' ').trim();
const visible = el => {
const r = el.getBoundingClientRect();
const st = getComputedStyle(el);
return r.width > 0 && r.height > 0 && st.display !== 'none' && st.visibility !== 'hidden';
};
const root = [...document.querySelectorAll('[data-testid], [data-cy], article, li, section, main')]
.filter(visible)
.filter(el => /flight|departure|arrival|select flight|price|\p{Sc}|\b(?:CHF|PLN|DKK|CZK|HUF|SEK|NOK|MAD)\b/iu.test(clean(el.innerText)))
.sort((a, b) => a.innerText.length - b.innerText.length);
const rows = [];
const seen = new Set();
for (const el of root) {
const text = clean(el.innerText);
if (!text || text.length < 20 || text.length > 1200) continue;
const key = text.slice(0, 500);
if (seen.has(key)) continue;
seen.add(key);
const timeMatches = text.match(/\b(?:[01]\d|2[0-3]):[0-5]\d\b/g) || [];
const C = '(?:\\p{Sc}|\\b(?:CHF|PLN|DKK|CZK|HUF|SEK|NOK|MAD)\\b)';
const price = (text.match(new RegExp(C + '\\s*\\d[\\d.,]*', 'iu')) || text.match(new RegExp('(?<![\\d:])\\d[\\d.,]*\\s*' + C, 'iu')) || [])[0] || null;
rows.push({text, times: [...new Set(timeMatches)], price});
if (rows.length >= 30) break;
}
return {url: location.href, title: clean(document.title), results: rows, bodyText: clean(document.body.innerText).slice(0, 4000)};
})()Possible Friction Points
- Start at
/en;/en/buy/flights?isOneWay=oncan redirect or stall behind a welcome modal without showing the search form. The Return/One-way switch appears only after opening the date picker; verify itsaria-checkedstate there before selecting a date. - The booking form uses airport-code-specific autocomplete IDs:
#{CODE}_from_optionand#{CODE}_to_option; select the suggestion rather than merely typing the code. - Calendar button test IDs use
D-M-YYYY, not zero-padded day or month values. - A cookie rejection button may appear as
button#ensRejectAds; treat it as optional because it is not always shown. - Submitting the form can trigger PerimeterX protection before results become available. Solve the challenge and wait before interacting with the results page; protection may recur after the welcome modal.
- A
dialog#welcomeModalmay appear after bot verification and must be confirmed or dismissed before the results UI is usable. - Result markup may vary, so the extractor intentionally returns visible, flight-related result containers plus a bounded body-text fallback. Prices and availability are time-sensitive.
- Do not retain or reproduce any values supplied through redacted or credential-like input events; only airport codes and the requested travel date belong in the search recipe.
Example Result
{
"url": "https://example.com/flights",
"title": "Example Title",
"results": [
{
"text": "Departure 08:30 Arrival 10:45 Select flight €120",
"times": [
"08:30",
"10:45"
],
"price": "€120"
}
],
"bodyText": "Example flight search results. Departure 08:30, arrival 10:45. Select flight €120."
}