Navigating around Security Certificate page on Microsoft Edge using Selenium WebDriver

Is there a way to bypass the Security Certificate page for Microsoft Edge when using Selenium Webdriver with Python?

https://i.stack.imgur.com/StSpB.jpg

I've tried solutions that have worked for Internet Explorer in the past, following suggestions from this thread, but none of them seem to do the trick.

driver.get("javascript:document.getElementById('overridelink').click();");

A code similar to the one above should theoretically work, but it appears that the Security Certificate page on Microsoft Edge has some distinct differences.

Answer №1

To navigate past the Security Certificate screen, follow these steps:

  • First, locate the desired_capabilities class within your Python folder. This class is typically found in the desired_capabilities.py file.

For example: C:\PythonXX\Lib\site-packages\selenium\webdriver\common

  • In the desired_capabilities.py file, ensure that the default desired capabilities object for the Microsoft Edge webdriver has the “javascriptEnabled” set to “True”. You may need to add this code manually.

https://i.stack.imgur.com/bAcsW.jpg

  • Within your code section that encounters the Security Certificate page, confirm that you are on the correct page and then use JavaScript to select the option to continue.

    if "Certificate error" in driver.title:
        driver.get("javascript:document.getElementById('invalidcert_continue').click()")
    

Note that the method for moving past the Security Certificate page differs between Microsoft Edge and Internet Explorer (IE). Keep this in mind as you proceed. Good luck!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Python Script for Automatically Following and Liking on Instagram

I'm experimenting with an Instagram follow/like bot as a Python beginner. Here is a snippet of code that I have been using: try: time.sleep(15) driver.refresh() time.sleep(3) if len(driver.find_elements_by_class_name('fr66n')) > 0: p ...

Struggling to use XPath to interact with a pop-up window in Selenium

Is there a way to retrieve 'CIK' codes from the 'SEC' using Selenium? When I try running the code, a "survey" pop-up appears that doesn't show up when doing it manually. This causes issues with my code because I can't inspect ...

Comparing the keydown actions in protractor versus selenium

Protractor: 5.4.1 Selenium: 3.14 geckodriver: 0.23 browser: firefox Hello there, I'm encountering an error message "Failed: sendKeysToActiveElement" when running the code below browser.actions().keyDown(protractor.Key.CONTROL).click(elements).keyUp( ...

The TypeError "list indices must be integers or slices, not str" occurs when the user input is not in the correct

Hello, I am just starting to learn Python and I have encountered an issue with my data. Whenever I try to input a student's name, the data appears but I am unable to modify it. The error message that pops up is: TypeError: list indices must be integer ...

Troubles arise when attempting to download a CSV file after clicking on an unfamiliar button on the website

I am facing a challenge with pressing what I had assumed to be a simple button on a website in order to download a CSV file. Unfortunately, the button seems to be elusive within the HTML code and even when I manage to locate it, it appears to have certain ...

Selenium fails to recognize changes in DOM after navigating back using browser's back button

I have a few pages that I am testing: =========== testpage1.htm =========== <p>This is my first test page</p> <input id="mysearch" type="image" onclick="return searchClick();" src="../../Img/arrow_large_down.gif" /> <span id="generat ...

What is the best way to initiate a Casperjs script using Python?

Having trouble using Subprocess. When trying to run the Casperjs file in the command prompt, I typically use this command: casperjs.bat test.js Unfortunately, Subprocess is failing because the script is not an executable file. This issue is occurring wit ...

rearranging elements in a tuple using Python

Is there a way to automatically switch the positions of elements within a tuple? For example, if I have a tuple ('a', 'b') and want it to be changed to ('b', 'a'). While I know this can be achieved by creating a new ...

What is the method to execute Popen using a custom shell?

I have been developing a tool that is designed to execute a series of commands. These commands are written as if they were being entered into a terminal or console. In order to achieve this, I have utilized Popen() with the parameter shell=True to replica ...

What is the process for combining two dataframes in pydatatable when they have distinct key column names?

My X dataframe looks like this: DT_X = dt.Frame({ 'date':['2020-09-01','2020-09-02','2020-09-03'], 'temp':[35.3,32.9,43.2] }) Out[4]: | date temp -- + ---------- ---- 0 | 202 ...

Loading sparsely populated arrays from numpy into chunked dask arrays

Attempting to convert a large 3D NumPy array (mostly zeros) into a chunked sparse Dask array. import sparse import dask.array as da input_arr = np.load(...) chunked_arr = da.from_array(input_arr, (32,32,32)).map_blocks(sparse.COO) Chunking seems to be s ...

I am interested in using Python with Selenium for web scraping

Running CHROME - version 116.0.5845.97 (official version) (64 bits), with ChromeDriver version 116.0.5845.96 in the same directory, I encountered a slight mismatch. from selenium import webdriver from selenium.webdriver.chrome.service import Service from ...

Python has an Abstract Data Type known as a double-ended queue

Develop an implementation of the ADT double-ended queue. This abstract data type is similar to a regular queue, but offers functionality to both add and remove elements from both ends of the queue. I am encountering some issues with the removal operation. ...

Succinct and versatile struct definition

In Python 2.7, I'm in need of defining a set of flexible structs (objects with a basic set of named fields that can be expanded with new fields later on, without requiring methods or inheritance). My current task involves reading data from binary file ...

Finding the correct xpath for elements with no tags can be a

<span class="specialid">xyz</span>"lmn" Is there a way to retrieve the value of lmn using XPath? I have successfully obtained xyz with //span[@class="specialid"] ...

TestNG.XML is failing to run when executed with Maven using the command 'mvn test', despite having correctly configured the POM.XML file

This is my first time asking a question on StackOverflow, so please excuse any inaccuracies. I have set up a maven project and am trying to run TestNG.XML through maven, but it's not working as expected. The output I'm getting is shown below: ...

Utilizing Numpy for optimizing np.argwhere's vectorization

I am currently working with numpy and have the following data structures: import numpy as np a = np.random.rand(267, 173) # dense image matrix b = np.random.rand(199) # array of probability samples My objective is to iterate through each value i in b, l ...

Working with a CSV file in Python: extracting a column and storing its values as individual variables for multiple

The "Codes" column consists of data in a CSV file with 12 columns and 5800 rows. I am looking to compare all the entries within this specific column and identify any duplicates. Is there a way to accomplish this? Codes: ['ARAMDS0001', 'ARA ...

Having trouble with Django's "return render()" not functioning properly in a view that is handling an ajax request

My goal is to initiate a chat room creation process by clicking a button on the initial page which then redirects me to the chat room page. I attempted to achieve this using an AJAX request but encountered a problem - my view function seems to halt at the ...

Encountering issues with launching a Selenium web driver project on version 3.8.1

Encountering difficulties running web driver 3.8.1 and geckodriver 0.19.1 while using guava versions 21 and 22. Running Firefox version 58.0.2 (64-bit) An error message is being displayed: java.lang.NoSuchMethodError: com.google.common.base.Preconditions ...