Chrome bot error - ERROR:platform_sensor_reader_win.cc

Asked

Viewed 176 times

0

I have a python application that performs some repetitive tasks for me by opening Chrome and using it as a bot (I cannot be making the code available because I work under a confidentiality agreement)but when executing it these errors appear and sometimes the program does not perform correctly.

DevTools listening on ws://127.0.0.1:58590/devtools/browser/46dd5f63-bae8-4996-85d9-92027184f6ee
[6892:7320:1009/142755.867:ERROR:platform_sensor_reader_win.cc(242)] NOT IMPLEMENTED
[6892:20824:1009/142756.610:ERROR:platform_sensor_reader_win.cc(242)] NOT IMPLEMENTED
[6892:26968:1009/142757.078:ERROR:platform_sensor_reader_win.cc(242)] NOT IMPLEMENTED

Could you enlighten me on exactly what these mistakes are ?

EDIT

Code I run to generate the error:

python webmatic_interactive.py --ou [ambiente de login] --login [chave de login] --partner [parceiro] --password [senha] --token [token de segurança] < [arquivo de onde são extraídos os dados ] > \\[caminho do servidor]\[ relatório do parceiro ]_2018-10-09_2052.txt

Code of webmatic_interactive.py:

from selenium import webdriver
import webmatic
import argparse
import sys
import proposal
import datetime

def get_context_webdrive():
return getattr(g, '_webdriver', None)

def set_context_webdrive(webdriver):
temp_driver = getattr(g, '_webdriver', None)
if temp_driver is not None:
    temp_driver.close()
g._webdriver =  webdriver   



parser = argparse.ArgumentParser()
parser.add_argument("--login", help="user login", type=str)
parser.add_argument("--password", help="user password", type=str)
parser.add_argument("--partner", help="partner code", type=str)
parser.add_argument("--token", help="token code", type=str)

parser.add_argument("--ou", help="organization unit", type=str)
parser.add_argument('pns', nargs='?', type=argparse.FileType('r'), default=sys.stdin)


args = parser.parse_args()
proposalDetails = args.pns.readlines()

proposal_logs = []


password = args.password


driver = webdriver.Chrome("/python/selenium/chromedriver.exe")
url = "[retirado por motivo de segurança]"

try:

for p in proposalDetails:
    prop = p.split(";")
    stripped_pi = prop[1].strip() 
    stripped_pn = prop[0].strip() 
    success, message, status = webmatic.run(args.ou, stripped_pn, args.login, args.partner, password, args.token, driver)
    print(str(success) + ": " + message)
    print("-------------")

    approval_status = "APROVADO" if success else "FALHA"

    # Pegando a última mensagem depois dos ":" caso não seja uma exception.
    log_message = (message) if ("Error" in message) else message.split(":")[-1]
    log_message = log_message.strip()
    
    proposalMessage = ""
    
    date = datetime.datetime.now()
    
    if (approval_status == "APROVADO" or status == "ANÁLISE PROMOTORA" or status == "FORMALIZA PORTABILIDADE" or status == "AGUARDANDO PORTABILIDADE"): 
        proposalMessage = proposal.ApprovePrius(stripped_pi,stripped_pn,args.ou,url)        
    else:
        proposalMessage = "Não aprovado no Promoter"
    
    proposal_log = "{0};{1};{2};{3};{4};{5};{6};{7}".format(date.strftime("%d-%m-%Y %H:%M"), args.ou, args.partner, status, stripped_pn, approval_status, log_message, proposalMessage)
    proposal_logs.append(proposal_log)
    
finally:
if not driver is None and not driver.session_id is None:
    driver.quit()
  • Since you cannot make the code available, make a MCVE and put in your question.

  • Yes I’ll be editing to fit some extra things

2 answers

1

The error is caused by this line of code:

https://chromium.googlesource.com/chromium/src/+/master/services/device/generic_sensor/platform_sensor_reader_win.cc#242

It occurs when the page tries to read a sensor, which is not implemented in Chrome for windows.

The sensors implemented are: ambient light sensor, accelerometer, gyroscope, magnetic meter, orientation meter.

If the page tries to use some other sensor that does not work in windows, for example temperature meter, air humidity meter, etc... anything, this error will appear.

Finally, pointed errors does not seem to be related to the program problem "not execute correctly". If you still have problems, I suggest you open another question.

0


Well I managed to resolve using a suggestion found on the github forum about Selenium which is to downgrade chromedriver to v2.33 and Chrome to V60-61 which are supported on chromedriver... From what I understand chromedriver has stopped implementing some functions process_metrics.cc and platform_sensor_reader_win.cc are now called otherwise within the code, I haven’t figured out how to... But if you want you can take a look at the following link https://github.com/SeleniumHQ/selenium/issues/5189 (Ta in English) has enough thing that the staff repaired and simply "fixed"

  • which Chrome you were using?

  • v69.0.3497.100 (x64)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.