Skip to content

Update core.py price class#7

Merged
AWeirdDev merged 2 commits intoAWeirdDev:mainfrom
d2x:main
Aug 28, 2024
Merged

Update core.py price class#7
AWeirdDev merged 2 commits intoAWeirdDev:mainfrom
d2x:main

Conversation

@d2x
Copy link
Contributor

@d2x d2x commented Aug 26, 2024

The classes used for price should be .YMlIz.FpEdX. There's a trailing e that causes the query to always return 0.

d2x added 2 commits August 26, 2024 14:26
The classes used for price should be `.YMlIz.FpEdX` but there's a trailing `e` that causes the query to fail.
Update core.py price class
@AWeirdDev
Copy link
Owner

AWeirdDev commented Aug 28, 2024

🔥🔥🔥 thanks a lot

@AWeirdDev AWeirdDev merged commit 34ca315 into AWeirdDev:main Aug 28, 2024
jimmyliu03 pushed a commit to jimmyliu03/google-flights that referenced this pull request Dec 3, 2025
Update core.py price class
LachyGroom added a commit to LachyGroom/flights that referenced this pull request Feb 15, 2026
The HTML parser relies on specific CSS class names (e.g. tPgKwe,
mv1WYe, Ak5kof, BbR8Ec) to extract flight details. However, Google
obfuscates these class names differently depending on the browser/TLS
fingerprint. Since primp's chrome_126 impersonation silently falls back
to a random fingerprint, ~25% of requests receive HTML with different
class names, causing airline name, departure/arrival times, duration,
and stops to all come back empty while price still works.

This adds a fallback that parses the aria-label attribute on each
flight item when any CSS selector returns empty data. The aria-label
always contains structured text regardless of fingerprint, e.g.:

  "From 2359 US dollars. Nonstop flight with Alaska. Leaves San Jose
   Mineta International Airport at 2:25 PM on Sunday, February 15 ..."

Also handles U+202F (narrow no-break space) that Google uses between
time digits and AM/PM in aria-labels.

Relates to AWeirdDev#7 (same class of bug for price CSS selector) and AWeirdDev#63
(duplicate flights from multiple container elements).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants