Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve this error in Selenium : ERROR: Couldn't read tbsCertificate as SEQUENCE, ERROR: Failed parsing Certificate

I'm trying to execute a selenium program in Python to go to a new URL on click of a button in the current homepage. I'm new to selenium and any help regarding this would be appreciated. Here's my code

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

url = 'https://nmit.ac.in'

driver = webdriver.Chrome()

driver.get(url)

try:
    # wait 10 seconds before looking for element
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located(By.LINK_TEXT, "Parent Portal")
    )

except:
    print()

driver.find_element(By.LINK_TEXT, "Parent Portal").click()

I have tried to increase the wait time as well as using all forms of the supported located strategies under the BY keyword, but to no avail. I keep getting this error. Error photo

like image 417
KrevoL Avatar asked Oct 25 '25 19:10

KrevoL


1 Answers

A lot of time passed while I was looking for a solution and I found it here.

options = webdriver.ChromeOptions()

options.add_experimental_option('excludeSwitches', ['enable-logging'])

driver = webdriver.Chrome(
    service= Service(chromedriver_path), 
    options=options,
)

driver.get('https://www.google.com/')

It should remove all annoying errors and warnings from selenium

like image 97
Eugene Avatar answered Oct 28 '25 10:10

Eugene