Answer the question
In order to leave comments, you need to log in
How to remove popup inscription when using selenium?
I have a python code :
def watching(
URL, PROXY
):
options = {
'proxy': {
'http': 'http://' + PROXY,
'https': 'https://' + PROXY,
'no_proxy': 'localhost,127.0.0.1'
}
}
chrome_options = ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument("--user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0'")
chrome_options.add_argument('--disable-infobars')
chrome_options.add_argument('--disable-extensions')
chrome_options.add_argument("--window-size=1920x1080")
chrome_options.add_argument('--ignore-certificate-errors-spki-list')
chrome_options.add_argument('--ignore-ssl-errors')
chrome_options.add_argument('--log-level=3')
chrome_options.add_argument('--blink-settings=imagesEnabled=false') # Не грузим img. Иначе 502 Bad Gateway если юзать IPv6...
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = Chrome(
chrome_options=chrome_options,
seleniumwire_options=options
)
driver.set_window_size(1920, 1080)
driver.get(URL)
driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
driver.find_element_by_xpath(
"""//a[@class="tgme_widget_message_owner_name"]"""
).click()
driver.close()
driver.quit()
127.0.0.1:58462: Client Handshake failed. The client may not trust Selenium Wire's certificate for fonts.gstatic.com.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question