Skip to content
Discussion options

You must be logged in to vote

Looks like Google removed the options that prevent the translate pop-up from appearing in Chrome, but fortunately that doesn't seem to interfere with automation that comes after that.

Additionally, PyAutoGUI can remove that pop-up by pressing "Esc" from a sync CDP Mode format:

sb.gui_press_key("Esc")

Eg:

from seleniumbase import sb_cdp

url = "https://www.corriere.it"
sb = sb_cdp.Chrome(url)
sb.wait_for_element("#privacy-cp-wall-accept")
sb.sleep(3)
sb.gui_press_key("Esc")
sb.sleep(3)
sb.driver.stop()

Sometimes that pop-up appears a few seconds after the page has loaded. You may need to adjust timing as needed.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nyg
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants