Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] stuck on about:blank with chrome~=130 #272

Closed
Skyceer opened this issue Oct 17, 2024 · 5 comments
Closed

[BUG] stuck on about:blank with chrome~=130 #272

Skyceer opened this issue Oct 17, 2024 · 5 comments
Labels
needs information more information needed unconfirmed a bug which hasn't been reproduced yet

Comments

@Skyceer
Copy link

Skyceer commented Oct 17, 2024

after chrome update Selenium-Driverless stopped working on version 130

Traceback

    await self.driver.set_window_size(50, 100)
  File "C:\Users\slavaadminAppData\Local\Programs\Python\Python310\lib\site-packages\selenium_driverless\webdriver.py", line 1136, in set_window_size
    await self.set_window_rect(width=int(width), height=int(height))
  File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium_driverless\webdriver.py", line 1217, in set_window_rect
    {"windowId": await self.current_window_id, "bounds": bounds})
  File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium_driverless\webdriver.py", line 925, in current_window_id
    return result["windowId"]
TypeError: 'NoneType' object is not subscriptable

also does not open pages with error asyncio.exceptions.TimeoutError
on version < 130 everything works fine

@kaliiiiiiiiii
Copy link
Owner

kaliiiiiiiiii commented Oct 17, 2024

@Skyceer please provide the script you used.

UPDATE:
If you encounter this issue, for now, downgrade to chrome<=130. See https://github.com/ScoopInstaller/Extras/commits/master/bucket/googlechrome.json

@kaliiiiiiiiii kaliiiiiiiiii changed the title [BUG] Does not work with chrome version 130.* [BUG] set_window_size fails on chrome~=130 Oct 17, 2024
@kaliiiiiiiiii kaliiiiiiiiii changed the title [BUG] set_window_size fails on chrome~=130 [BUG] set_window_size fails on chrome~=130 Oct 17, 2024
@kaliiiiiiiiii kaliiiiiiiiii added the needs information more information needed label Oct 17, 2024
@Skyceer
Copy link
Author

Skyceer commented Oct 17, 2024

The problem is not just with set_window_size, but with any interaction with the browser after startup. The readme code that is provided as an example does not work either

from selenium_driverless import webdriver
from selenium_driverless.types.by import By
import asyncio


async def main():
    options = webdriver.ChromeOptions()
    async with webdriver.Chrome(options=options) as driver:
        await driver.get('http://nowsecure.nl#relax', wait_load=True)
        await driver.sleep(0.5)
        await driver.wait_for_cdp("Page.domContentEventFired", timeout=15)

        # wait 10s for elem to exist
        elem = await driver.find_element(By.XPATH, '/html/body/div[2]/div/main/p[2]/a', timeout=10)
        await elem.click(move_to=True)

        alert = await driver.switch_to.alert
        print(alert.text)
        await alert.accept()

        print(await driver.title)


asyncio.run(main())

Browser with about:blank link is launched, the script tries to open the link but gets an exception

asyncio.exceptions.TimeoutError: page: "http://nowsecure.nl#relax" didn't load within timeout of 30

The problem occurs on several machines after updating chrome to version 130

@Skyceer Skyceer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@Skyceer Skyceer reopened this Oct 17, 2024
@kaliiiiiiiiii kaliiiiiiiiii changed the title [BUG] set_window_size fails on chrome~=130 [BUG] stuck on about:blank for chrome~=130 Oct 17, 2024
@kaliiiiiiiiii kaliiiiiiiiii changed the title [BUG] stuck on about:blank for chrome~=130 [BUG] stuck on about:blank with chrome~=130 Oct 17, 2024
@kaliiiiiiiiii kaliiiiiiiiii pinned this issue Oct 17, 2024
@kaliiiiiiiiii
Copy link
Owner

kaliiiiiiiiii commented Oct 17, 2024

@Skyceer Can't reproduce that on the dev branch of driverless (does the dev branch work for you?) Also, what env are you on?

tested on Win10, 130.0.6723.59 (Offizieller Build) (64-Bit) (cohort: Stable Installs & Version Pins)

@kaliiiiiiiiii kaliiiiiiiiii added the unconfirmed a bug which hasn't been reproduced yet label Oct 17, 2024
@Skyceer
Copy link
Author

Skyceer commented Oct 18, 2024

Even the dev branch doesn't work for me

main machine:
Win 11 23H2
chrome version: 130.0.6723.59 (Official Build) (64-bit) (cohort: Stable)
Python version: 3.10.11

second machine:
Win 2022 21H2
chrome version130.0.6723.59 (Official Build) (64-bit) (cohort: Stable)
Python Version: 3.11.9

The problem is observed on two envs after upgrading chrome to version 130

tested on the example from readme

@kaliiiiiiiiii
Copy link
Owner

kaliiiiiiiiii commented Oct 21, 2024

Changing to

if info.type == "page" and not info.title.startswith("chrome-extension://"):

from

{'targetId': '5FA2CCC5000335504CA5D730DE687E2C', 'type': 'page', 'title': '', 'url': 'chrome-extension://neajdppkdcdipfabeoofebfddakdcjhd/audio.html', 'attached': False, 'canAccessOpener': False, 'browserContextId': 'A4950040BC30D1949F4726F7993F4F80'}, {'targetId': '41F79EA0DAC1790699952CF9011B9413', 'type': 'background_page', 'title': 'Google Hangouts', 'url': 'chrome-extension://nkeimhogjdpnpccoofpliimaahmaaome/background.html', 'attached': False, 'canAccessOpener': False, 'browserContextId': 'A4950040BC30D1949F4726F7993F4F80'}

Might be the cause
Credits go to discord message

kaliiiiiiiiii added a commit that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs information more information needed unconfirmed a bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants