1

I was wondering if there is any method to hide the "Uncaught SecuriyError that is produced from the console. I believe the error message is being provided by the website, but I am unsure. My program works as intended but it is just annoying seeing the error message constantly appear during runtime. As a side note, I do not see any of these errors when running in PYCharm.

Any help would be great! Thanks!

34 out of 37 completed
[0630/015306.733:INFO:CONSOLE(11)] 
"Uncaught SecurityError: Blocked a frame 
with origin "https://ws2.osfi-bsif.gc.ca" 
from accessing a frame with origin 
"https://www.osfi-bsif.gc.ca". Protocols, 
domains, and ports must match.", source: 
https://ws2.osfi- 
bsif.gc.ca/WebApps/FINDAT/DTIBanks.aspx? 
T=0&LANG=E (11)
[0630/015307.079:INFO:CONSOLE(11)] 
"Uncaught SecurityError: Blocked a frame 

1 Answers1

0

Take a look at https://stackoverflow.com/a/63625977/1387701

"""get log entreies from selenium and add to python logger before returning"""
loglevels = { 'NOTSET':0 , 'DEBUG':10 ,'INFO': 20 , 'WARNING':30, 'ERROR':40, 'SEVERE':40, 'CRITICAL':50}

#initialise a logger
browserlog = logging.getLogger("chrome")
#get browser logs
slurped_logs = driver.get_log('browser')
for entry in slurped_logs:
    #convert broswer log to python log format
    rec = browserlog.makeRecord("%s.%s"%(browserlog.name,entry['source']),loglevels.get(entry['level']),'.',0,entry['message'],None,None)
    rec.created = entry['timestamp'] /1000 # log using original timestamp.. us -> ms
    try:
        #add browser log to python log
        browserlog.handle(rec)
    except:
        print(entry)
DMart
  • 2,401
  • 1
  • 14
  • 19