Chrome bot error - ERROR: platform_sensor_reader_win.cc

0

I have a python application that performs some repetitive tasks by opening the chrome and using it as a bot (I can not make it available because I work with a stealth agreement), but when I run it, these errors appear and some 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 clarify what exactly these errors are?

EDIT

Code that 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

Webmatic_interactive.py code:

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()
    
asked by anonymous 09.10.2018 / 19:34

2 answers

0
Well I've managed to solve using a suggestion found in the github forum about selenium which is to downgrade in chromedriver for v2.33 and in chrome for v60-61 which are supported on chromedriver ... By what I understood the chromedriver has stopped implementing some functions process_metrics.cc and platform_sensor_reader_win.cc now they are called otherwise inside the code, I did not find out how ... But if you want you can have a look at the following link link has a lot of stuff that people noticed and" fixed "in a simple way

    
11.10.2018 / 02:43
1

The error is caused by this line of code:

link

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 on windows, eg temperature gauge, air humidity gauge, etc ... anything, this error will appear.

Finally, the errors pointed out do not seem to be related to the problem of the "do not execute correctly" program. If you continue with problems, I suggest opening another question.

    
10.10.2018 / 02:34