-
Notifications
You must be signed in to change notification settings - Fork 20
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
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: None #17
Comments
Hi! Thanks for filing this issue! I noticed a similar problem with the program clicking the wrong button after being redirected to the cookie consent page a while back, and added a change to address the issue in commit 62464aa. However, in my case the program was clicking a button to select the display language (English, Spanish, etc.) and the program would time out on the cookie consent page itself (it did not even get past the "Submit" part). The change made above fixed that issue, but the problem you're facing seems slightly different. In any case, it might be worth it to try running the program with the updated code locally (this change was made after the last release, so it will be available in release 0.6.4) to see if the change addresses your problem too. After you clone/fork the repo and have it locally, try running
then try rerunning the program again. If this fixes the problem, then everything should be okay (these changes will eventually be available with the PyPI package in release 0.6.4), but if this does not fix the problem, you could try checking out the links I found below (included below the first horizontal line divide). Another simple workaround could be to set the
This technically does not address the error you're seeing since the program will just accepts cookies instead of blocking them (which is the default behavior), but this might be good enough to unblock you temporarily until we figure out a proper fix. I haven't seen the specific error or stack trace that you included, so I looked up potential causes and solutions and found a couple other posts that faced a similar issue. You might have already seen these, but I'll include them here just in case so that if you missed any of them, or if someone else is facing a similar issue, they can also see the posts and use them as a starting point for debugging:
Searching for
If none of the above works, it might be worth debugging more and looking at the full stack trace - the code right now includes just the error message and hides the full stack trace for the original error, so you see
You did already include part of the stack trace under the "Python script logging info" part of your post (the last part in the code snippet above), but based on how I wrote the error handling, the stack trace (currently) shows only the most recent error that causes the program to crash, instead of the whole chain of errors (if there were multiple errors). For example, if there was an error that caused another error, and that error caused another error, I think the program only shows the last of the 3 errors, instead of all 3 errors. Hopefully something here helps you debug the problem here, but in case nothing works, I'll add a change to see the full stack trace soon. I didn't know how to properly |
Hi slow-but-steady, Only for info, here is the error after change, I think that is the same: You are using yt_videos_list package version >= 0.6.0 (currently 0.6.3). There are some formatting changes to the output files as of release 0.6.0 that may potentially interfere with your workflow, so please review https://github.com/slow-but-steady/yt-videos-list/releases/tag/v0.6.0 to see if you need to do anything. There are also some changes to the Thanks! Redirected to consent.youtube.com! Traceback (most recent call last): ===>ERROR!<=== Try running the program again with headless=False if you are currently running the program with headless=True. For further debugging, this was the exact error message (might also be blank): |
Hi!
firstly let me say you thanks. This is a good solution to me.
Since last month my script do not work, some errors are shown and I not sure if here is an issue.
Here go the logging information from geckodriver and from python execution.
Thanks in advance.
Python script logging info:
File "/usr/local/lib/python3.9/dist-packages/yt_videos_list/logic.py", line 134, in load_page
wait.until(EC.element_to_be_clickable((By.XPATH, channel_heading_xpath)))
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/support/wait.py", line 71, in until
value = method(self._driver)
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/support/expected_conditions.py", line 297, in call
element = visibility_of_element_located(self.locator)(driver)
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/support/expected_conditions.py", line 128, in call
return _element_if_visible(_find_element(driver, self.locator))
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/support/expected_conditions.py", line 415, in _find_element
raise e
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/support/expected_conditions.py", line 411, in _find_element
return driver.find_element(*by)
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/errorhandler.py", line 241, in check_response
raise exception_class(message, screen, stacktrace, alert_text)
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: None
Message: Dismissed user prompt dialog: This site is asking you to sign in.
geckodriver logging info:
1643352442766 geckodriver INFO Listening on 127.0.0.1:38755
1643352442786 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "-headless" "-no-remote" "-profile" "/tmp/rust_mozprofilea68MXZ"
*** You are running in headless mode.
[GFX1-]: glxtest: Unable to open a connection to the X server
[GFX1-]: glxtest: libEGL initialize failed
[GFX1-]: No GPUs detected via PCI
1643352446042 Marionette INFO Marionette enabled
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofilea68MXZ/search.json.mozlz4", (void 0)))
1643352452123 Marionette INFO Listening on port 43291
1643352452302 RemoteAgent WARN TLS certificate errors will be ignored for this session
1643352456889 Marionette WARN Ignoring event 'pageshow' because document has an invalid readyState of 'uninitialized'.
1643352460748 Marionette INFO Stopped listening on port 43291
JavaScript error: resource:///modules/Interactions.jsm, line 209: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
The text was updated successfully, but these errors were encountered: