Updated Chrome to 113.0.5672.127
, downloaded ChromeDriver 113.0.5672.63
but scripts stopped working. Looks like first line of script where I try to manipulate elements on page are not working now no matter what.
Examples of error text:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//iframe"}
(Session info: headless chrome=113.0.5672.127)
and:
WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[starts-with(@ng-click,'clickEdit')]"))).click()
It's literally first lines and they worked for months. Can someone help to understand what's the problem?
Tried to use other versions of ChromDriver but it didn't help.
Edit:
So after some reserch I found out that page had an error and this error is cause of my problems but looks like error was caused by my script after update in there first place. Now page is unavailable to me because of this error but I have over similar pages and can recreate the process.
Looks like if I run scrips with "chrome_options.add_argument("--headless")"(I want chrome to be hidden) I get this message in cmd window: DevTools listening on ws://127.0.0.1:52759/devtools/browser/05d5b34e-667c-4beb-a9a8-d87a52a3dd82 [0517/124106.941:INFO:CONSOLE(0)] "Autofocus processing was blocked because a document already has a focused element.", "link".
After that there is a error on this page and page is unavailable after that for me. But if I run script without "chrome_options.add_argument("--headless")" on page where is no error yet - all is good. Some crazy things is happening, can someone help to understand what is going on?