Selenium: The code fails to execute a specific function

I am facing an issue with my script. The code between the specified problem-comments is not executing as expected. This script is designed to log into the Yandex-mail page (), locate the search-field for mails using XPath, click on it, and input the text "subject:(Your Steam account: Access from new web or mobile device)". However, the script abruptly shuts down when attempting to find the search-field.

Here is the provided code snippet:

insert unique rewritten code here...

I have attempted to run the code but encountered the following errors:

Errors prior to encountering the issue:

[34024:23964:0301/191243.416:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -101
[7428:42888:0301/191245.636:ERROR:device_event_log_impl.cc(218)] [19:12:45.637] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Ein an das System angeschlossenes Gerõt funktioniert nicht. (0x1F)
[7428:42888:0301/191245.642:ERROR:device_event_log_impl.cc(218)] [19:12:45.642] USB: usb_device_handle_win.cc:1046 Failed to read descriptor from node connection: Ein an das System angeschlossenes Gerõt funktioniert nicht. (0x1F)

Errors after encountering the issue:

[34024:23964:0301/191254.717:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -101
[34024:23964:0301/191254.722:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -101 

Answer №1

It appears that in the code below, you mistakenly used the ID locator when you should have used the XPath locator instead.

inbox_element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "//*[@id='js-apps-container']/div[2]/div[7]/div/div[1]/div/div/div[1]/div[2]/div/div/div/div[1]/form/div/span/input")))

To correct this, change it to By.XPATH, since you are actually using an XPath expression to find the element.

Answer №2

This particular error message indicates a failed handshake during SSL communication.

[34024:23964:0301/191243.416:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -101

It suggests that the browser is prompting you to approve the certificate from a certain website.


Solution

To bypass these errors in ChromeDriver, you can set up specific arguments as shown below:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--ignore-certificate-errors')
options.add_experimental_option('--ignore-ssl-errors')
driver = webdriver.Chrome(options=options)
driver.get('https://passport.yandex.ru/auth')

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

Selenium WebDriver is struggling to locate an element using link text

I'm currently facing a challenge in selecting an element that contains an anchor within a paragraph inside a div. The HTML structure I am working with is as follows: <a class="item" ng-href="#/catalog/90d9650a36988e5d0136988f03ab000f/category/DATA ...

Initializing JBrowserDriver can be quite time-consuming, often taking over a minute to complete

Currently, I am utilizing JBrowserDriver to capture screenshots from various pages. However, a noteworthy issue arises when I initialize the driver variable as it takes a considerable amount of time, approximately 70 seconds. JBrowserDriver driver = new ...

Harnessing the Power of HTTPS Proxy in Selenium WebDriver ChromeDriver

Even though I managed to successfully use a proxy, I encountered an issue where the proxy is only applied to http and not https. Below is the code snippet I am currently using: Proxy proxy = new Proxy(); proxy.setHttpProxy("myproxy:8080"); DesiredCapabil ...

Accessing a document using protractor

It seems like every protractor example I come across online uses browser.get with a web URI. browser.get('http://localhost:8000'); I want to use Selenium to navigate to a local file:// path without needing a web server running. Just a simple HT ...

Develop a query language using Python

I'm seeking a method to make filtering capabilities accessible to fellow developers and potentially clients within my workplace. Challenge I aim to introduce a basic query language for my data (stored as python dicts) that can be used by other devel ...

Deleting an interceptor parameter in Selenium Wire with Python

I could really use some assistance. Currently, I am utilizing Selenium Wire to manage the requests from a website and I need to adjust certain settings in these requests. I came across the request_interceptor method which is working perfectly. However, I ...

Exploring alternative methods for extracting ASINs from Amazon webpages using Python and Selenium

So I'm trying to extract the ASIN from an Amazon webpage using the following code: asin = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.ID, "averageCustomerReviews"))).get_attribute("data-asin") However, I&apos ...

What is the best way to calculate the average of 2-dimensional arrays that contain nan values?

I have a collection of 12 .grd files located in the same directory, all formatted as 2-dimensional arrays. To calculate their average values, I initially used a simple loop method ave_value = np.zeros_like(test_array) # creating an array with zeroes for ...

Determining the Euclidean distance between row combinations in a pandas dataframe: A guide

I am dealing with a DataFrame that contains information about clusters and their respective variables: import pandas as pd foo = pd.DataFrame({'cluster': [1,2,3], 'var1': [0.3,0.5,1], 'var2&apo ...

Steps to resolve the selenium error "Message: no such element: Unable to locate element"

I'm encountering an issue with my script where I keep getting the error message: no such element found This is a segment of my code: driver = webdriver.Chrome(r'C:\\chromedriver_win32\\chromedriver.exe') driver.get(" ...

finding elements using Appium is ineffective when it comes to multiple elements

My aim is to retrieve all elements along with their values from a table containing multiple items (IOS). All the items in the table have the same name but different values. I am attempting to fetch all elements at once using: List<WebElement> l = d ...

Heroku-exclusive Development Environment Encountering Problem with Chrome Version 81

Recently, there was an update to the google-chrome buildpack on Heroku which caused issues with the Chrome version. On my development instance, the version shows as 80.0.3987.163, while on the production instance it is 81.0.4044.92. The question now is ho ...

The RemoteWebDriver is currently unable to upload the file

Having trouble uploading a file on a demo site using RemoteWebDriver? You’ve successfully done it with the regular WebDriver driver, but now facing issues with RemoteWebDriver. The exception thrown is :"org.openqa.selenium.WebDriverException: Settin ...

Steps for generating a dictionary where the connecting column matches a value in the list:

How do I tally the occurrences of values from a list in a Python dictionary and produce a new dictionary Take, for instance, the following list: list = [1,2,3,4,5,6,7,8,9]     dict = {1:[15,2,72,7,62,71,13,6,153,154,73,39],2:[16,15,61,1,71,72,39,4,74,1 ...

Error: Can const be used in strict mode?

Currently, I am attempting to log in to facebook.com using selenium-webdriver. var webdriver = require('selenium-webdriver'), By = require('selenium-webdriver').By, until = require('selenium-webdriver').until; var dr ...

Generate JSON Data from Comma-Separated Values

I have a CSV file containing the following data. Check out the image for reference. I'm working with pandas in Python. My goal is to convert this data into JSON format structured like this: { "VMName": "vm101", ...

Steps to clearly specify a variable as static in Python

Is there a way in Python to designate a variable as static, ensuring only one instance is created in memory and remains unchanged each time the program runs, rather than generating a new copy each time? ...

Utilize protractor to access the window object or browser scope in your test scripts

While conducting tests with protractor, I have encountered difficulty in accessing the JS 'window' object. I attempted to add a script tag in my HTML file containing something like var a = window.location; However, when I tried using expect(a) ...

Discovering the previous sibling using xpath in Selenium: A guide

Having some trouble clicking on the checkbox after using siblings. Can anyone help me figure out what's wrong with it? Code: checkbox1 = driver.find_element_by_xpath("td/nobr/a[text()='192.168.50.120']/../preceding-sibling::td/input[@class ...

Where is the close window button located in Selenium for automation purposes?

I am currently facing an issue with automating messages on LinkedIn. Specifically, I am struggling to close the chat window using Selenium. Can someone guide me through fixing this problem? This is my first attempt at using Selenium and any help would be g ...