selenium報錯解決辦法

2022-08-18 01:54:11 字數 1036 閱讀 5513

當瀏覽器要求您接受來自**的證書時,會出現此錯誤。

您可以設定為預設忽略這些錯誤,以避免這些錯誤。

對於chrome,您需要新增--ignore-certificate-errors--ignore-ssl-errorschromeoptions()引數:

options = webdriver.chromeoptions()

options.add_argument('--ignore-certificate-errors')

options.add_argument('--ignore-ssl-errors')

options.add_argument('--ignore-certificate-errors-spki-list')
driver = webdriver.chrome(chrome_options=options)
對於firefox,您需要將accept_untrusted_certsfirefoxprofile()選項設定為true:

profile = webdriver.firefoxprofile()

profile.accept_untrusted_certs = true

driver = webdriver.firefox(firefox_profile=profile)

對於internet explorer,您需要設定acceptsslcerts所需的功能:

capabilities = webdriver.desiredcapabilities().internetexplorer

capabilities['acceptsslcerts'] = true

driver = webdriver.ie(capabilities=capabilities)

Rstudio報錯解決辦法

在伺服器上面使用rstudio是非常方便的,但是有時候,rstudio會出現各種報錯 我們今天主要說一下,連線不上r服務的問題 報錯資訊下次遇到了再補上,今天一步一步的做,沒來的及截圖 我在網上發現了許多種方法,有的行,有的不行,而且有的還非常麻煩,還要解除安裝了重新安裝 我在基因課王瑩老師的幫助下...

幾種報錯的解決辦法

呼叫google api,缺失庫報錯 importerror no module named google 解決方案 出現這個錯誤,就是因為沒有安裝google api相應的庫,按照如下命令安裝即可,把庫名換成你所需要的相應的庫名即可 pip install google cloud speech ...

npm install 安裝報錯解決辦法

解決 安裝 chromedriver 即可 npm install chromedriver chromedriver cdnurl 刪除npmrc檔案 注意 不是nodejs安裝目錄npm模組下的那個npmrc檔案,而是在c users 下的.npmrc檔案 直接用命令清理 控制台輸入 npm c...