6

I am trying to test selenium for a solution to auto log into a website but I cant even get Selenium to stay open. It does what it is supposed to do right now and then quits immediately without a driver.quit(). I get the following errors and I wish to understand what they mean:

DevTools listening on ws://127.0.0.1:51111/devtools/browser/111111fe-423z-111zz-1116-r0z2300086f7
[3420:22152:1110/151643.950:ERROR:edge_auth_errors.cc(387)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:  

[3420:22152:1110/151644.757:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.
[3420:22152:1110/151647.899:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.
Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos
https://www.yahoo.com/

This is my code:

from selenium import webdriver
from selenium.webdriver.edge.service import Service

ser = Service("C:\\Users\\Desktop\\Projects\\auto_login\\msedgedriver.exe")
driver = webdriver.Edge(service = ser)
driver.get("http://yahoo.com")
print(driver.title)
print(driver.current_url)
4
  • this could be a hung driver... check running tasks. Be sure to use driver.quit() method each time you launch a driver. The error is related to Edge authorization.. I think it requires a user to be logged in to the domain when running.... but seems like that is a red herring. A previously orphaned webdriver is probably causing it. Commented Nov 10, 2021 at 21:11
  • Which version of Edge browser and Edge WebDriver are you using? Which version of Selenium are you using? I test with your code, it will show the errors you mention but the code can run well. Edge browser won't close unless I put driver.quit() at the end of the code. I think we can ignore the above errors. Commented Nov 11, 2021 at 9:12
  • Both are Version 95.0.1020.44, Selenium 4. Commented Nov 12, 2021 at 14:13
  • I think you're doing the right thing. Your selenium test is running well. I agree with DebanjanB's answer. You can ignore the error and check if you're using any python frameworks which make the browser close automatically. Commented Nov 15, 2021 at 2:12

4 Answers 4

7

I found the following code would disable the "DevTools listening on ..." errors (warnings?).

from selenium import webdriver
from selenium.webdriver.edge.options import Options as EdgeOptions

options = EdgeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Edge(options=options)

I am using Selenium 4.5.0 and Edge driver Edge version 105. It is basically the same code used for disabling these types of messages on Chrome drivers.

Sign up to request clarification or add additional context in comments.

Comments

4

The errors you are seeing:

[3420:22152:1110/151643.950:ERROR:edge_auth_errors.cc(387)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:  

[3420:22152:1110/151644.757:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.
[3420:22152:1110/151647.899:ERROR:fallback_task_provider.cc(119)] Every renderer should have at least one task provided by a primary task provider. If a fallback task is shown, it is a bug. Please file a new bug and tag it as a dependency of crbug.com/739782.

are the result of a generic bug due to Chrome spawned a child process & Task Manager compatibility which you can ignore as of now. For details check Issue 739782: [Task Manager] [Meta bug ☂️] Processes not shown in Task Manager.

Additionally, some specific python frameworks tends to close the browser automatically when all the lines of the program are executed successfully e.g. Python-Unittest and have no relation with the errors explained above.

Comments

0

I am using Selenium 4.6 with User-agent random

from selenium import webdriver
from selenium.webdriver.edge import service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from fake_useragent import UserAgent
import os
os.system("cls")



def User():
    
    ua = UserAgent()
    return ua.random


edgeOption = webdriver.EdgeOptions()
edgeOption.add_argument(f'user-agent={User()}')
edgeOption.add_argument("start-maximized")
s=service.Service(r'msedgedriver.exe')
driver = webdriver.Edge(service=s, options=edgeOption)
driver.get("http://whatsmyuseragent.org/")
WebDriverWait(driver, 10)

user = driver.find_element(By.XPATH, "//div[@class='intro-body']/div[@class='container']/div[@class='row']/div[@class='col-md-8 col-md-offset-2'][1]/div[@class='user-agent']/p[@class='intro-text']").text
ip = driver.find_element(By.XPATH, "//div[@class='intro-body']/div[@class='container']/div[@class='row']/div[@class='col-md-8 col-md-offset-2'][2]/div[@class='ip-address']/p[@class='intro-text']").text

print(user)
print(ip)

Comments

0

Maybe kindda late but updating the webdriver with the lastest version solved my issue:

[19204:19348:0902/234717.979:ERROR:edge_auth_errors.cc(523)] 


EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.