0

I have a problem with my script. after about 10 times I run the commands below this error comes out:

Timed out receiving message from renderer: 59,996

I use as ubuntu operating system

  • selenium version is 3.141.0
  • chrome version = 88.0.4324.150
  • chromewebdriver = 88.0.4324.96 for linux 64

How can i solve?

I can't understand what this error might be about

error

import time
import os
import datetime

from selenium import webdriver #importa libreria selenium
from selenium.webdriver.common.keys import Keys #importa funzione per centrare elemento su pagina 
from selenium.webdriver.common.action_chains import ActionChains #importa funzione per centrare elemento su pagina 
from selenium.webdriver.support.select import Select #importa funzione per selezionare elemento da menu' a discesa
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from logger import logger as l
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options

email='email'
password='password'
url='https://www.unieuro.it/online/Console-Playstation-5/PlayStation-5-pidSONPS5DISC' #url del oggetto da tenere monitorato
numerocel='cellular'

chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("enable-automation")
#chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--dns-prefetch-disable")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--disable-xss-auditor")
chrome_options.add_argument("--disable-web-security")
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("--allow-running-insecure-content")
 
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.set_page_load_timeout(60)  # Timeout 15 seconds
#driver = webdriver.Chrome('./chromedriver')  # devifinisci il nome del driver

driver.implicitly_wait(60) 
driver.maximize_window() #massimizza il browser
driver.get(url) #andare al indirizzo richiesto sul campo url
time.sleep(5) #pausa prima di eseguire il comando successivo

#verifica disponibilità
dis=None
while not dis:
    try:
        i=None
        i = datetime.datetime.now()
        print ("Data e ora corrente = %s" % i)
        dis=driver.find_element_by_css_selector('a.btn-orange-normal:nth-child(2)') #verifica se è presente il bottone aggiungi al carello
        print('in stock unieuro')
    except Exception as e:
        print('out of stock unieuro')
        time.sleep(10)
        driver.refresh()  #ricarica la pagina e riesegui il controllo
        time.sleep(30)
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I tried as recommended to remove all your options but it didn't solve the problem? in my opinion it is a refresh problem is there another way to do it? or could it be the while not function that's not okay? – luca honda Feb 10 '21 at 05:28

1 Answers1

0

This error message...

Timed out receiving message from renderer: 59,996

...implies that the ChromeDriver was unable to communicate with the Browsing Context i.e. Chrome Browser session.

The most probhable reason is you have configured the ChromeDriver too many unnecessary arguments.


Solution

Remove the unnecessary arguments and retest as follows:

import time
import os
import datetime

from selenium import webdriver #importa libreria selenium
from selenium.webdriver.common.keys import Keys #importa funzione per centrare elemento su pagina 
from selenium.webdriver.common.action_chains import ActionChains #importa funzione per centrare elemento su pagina 
from selenium.webdriver.support.select import Select #importa funzione per selezionare elemento da menu' a discesa
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from logger import logger as l
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options

email='email'
password='password'
url='https://www.unieuro.it/online/Console-Playstation-5/PlayStation-5-pidSONPS5DISC' #url del oggetto da tenere monitorato
numerocel='cellular'

chrome_options = Options()
chrome_options.add_argument("start-maximized")
driver = webdriver.Chrome(options=chrome_options)
driver.set_page_load_timeout(60)  # Timeout 15 seconds
driver = webdriver.Chrome('path/to/chromedriver')  # devifinisci il nome del driver
driver.get(url) #andare al indirizzo richiesto sul campo url
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    I tried as recommended to remove all your options but it didn't solve the problem? in my opinion it is a refresh problem is there another way to do it? or could it be the while not function that's not okay? – luca honda Feb 10 '21 at 05:28