sync
This commit is contained in:
+3
-3
@@ -136,16 +136,16 @@ def get_rating_distribution(
|
||||
browser = playwright.chromium.launch(**launch)
|
||||
context = browser.new_context(locale="pl-PL", viewport={"width": 1100, "height": 800})
|
||||
try:
|
||||
report(50, "Otwarto Chromium")
|
||||
report(50, "Trwa łączenie z Google Maps")
|
||||
page = context.pages[0] if context.pages else context.new_page()
|
||||
context.add_init_script(
|
||||
"Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
|
||||
)
|
||||
page.goto(url, wait_until="domcontentloaded", timeout=30_000)
|
||||
_accept_cookies(page)
|
||||
report(75, "Załadowano Google Maps")
|
||||
report(75, "Ładowanie opinii")
|
||||
_open_reviews(page)
|
||||
report(90, "Otwarto panel opinii")
|
||||
report(90, "Obliczanie statystyk")
|
||||
page.wait_for_timeout(700)
|
||||
labels = page.locator("[aria-label]").evaluate_all(
|
||||
"els => els.map(el => el.getAttribute('aria-label')).filter(Boolean)"
|
||||
|
||||
Reference in New Issue
Block a user