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.
– nosklo
Yes I’ll be editing to fit some extra things
– Gunblades