fix: hover onto card itself to keep it open during stage 2 expansion
This commit is contained in:
parent
9225c4e778
commit
af9a42f7eb
@ -92,23 +92,23 @@ class Resolver:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# The hover card is two-stage: basic info first, then expands to show email.
|
# Stage 1: wait for card container to appear
|
||||||
# Wait directly for the mailto link (covers both stages, longer timeout).
|
self._page.wait_for_selector(".lpc_ip_root_class", timeout=5_000)
|
||||||
self._page.wait_for_selector(
|
|
||||||
".lpc_ip_root_class a[href*='mailto:']", timeout=10_000
|
|
||||||
)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
# Card may have appeared but without a mailto link — check what's there
|
print(f" Hover-Card für '{display_name}' erscheint nicht.")
|
||||||
card = self._page.query_selector(".lpc_ip_root_class")
|
|
||||||
if card:
|
|
||||||
card_text = card.inner_text().strip()[:200]
|
|
||||||
print(f" Karte für '{display_name}' offen, E-Mail nicht gefunden. Inhalt: {card_text!r}")
|
|
||||||
else:
|
|
||||||
print(f" Hover-Card für '{display_name}' erscheint nicht.")
|
|
||||||
self._page.mouse.move(0, 0)
|
self._page.mouse.move(0, 0)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Move mouse onto the card itself to keep it open while stage 2 loads
|
||||||
|
card_el = self._page.query_selector(".lpc_ip_root_class")
|
||||||
|
if card_el:
|
||||||
|
card_el.hover()
|
||||||
|
|
||||||
|
# Stage 2: wait for the email link to appear (card expands)
|
||||||
|
self._page.wait_for_selector(
|
||||||
|
".lpc_ip_root_class a[href*='mailto:']", timeout=8_000
|
||||||
|
)
|
||||||
email_el = self._page.query_selector(".lpc_ip_root_class a[href*='mailto:']")
|
email_el = self._page.query_selector(".lpc_ip_root_class a[href*='mailto:']")
|
||||||
email = None
|
email = None
|
||||||
if email_el:
|
if email_el:
|
||||||
@ -117,7 +117,9 @@ class Resolver:
|
|||||||
self._page.mouse.move(0, 0)
|
self._page.mouse.move(0, 0)
|
||||||
time.sleep(0.3)
|
time.sleep(0.3)
|
||||||
return email
|
return email
|
||||||
except Exception as e:
|
except Exception:
|
||||||
print(f" Fehler beim Lesen der Hover-Card: {e}")
|
card = self._page.query_selector(".lpc_ip_root_class")
|
||||||
|
card_text = card.inner_text().strip()[:200] if card else "(leer)"
|
||||||
|
print(f" Karte für '{display_name}' offen, E-Mail nicht gefunden. Inhalt: {card_text!r}")
|
||||||
self._page.mouse.move(0, 0)
|
self._page.mouse.move(0, 0)
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user