R
R
resresres2021-07-29 21:07:56
Python
resresres, 2021-07-29 21:07:56

The selenium program does not work, what should I do?

Good afternoon, I've been trying to fix this for the 4th hour, but nothing comes out

from selenium import webdriver
from time import sleep

chop = webdriver.ChromeOptions()
chop.add_extension("9.8.3_0.crx")

sleep(3)
driver = webdriver.Chrome(options=chop)

sleep(3)
driver.get('https://pancakeswap.finance/swap')

sleep(3)
driver.switch_to_window(driver.window_handles[-1])

with this code, something is wrong, it either works, or it doesn’t work, and such an error is shown
Traceback (most recent call last):
  File "C:\Desktop2.0\coding\New folder\Idle.py", line 8, in <module>
    driver = webdriver.Chrome(options=chop)
  File "C:\Users\Rasul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\Rasul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\Rasul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\Rasul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Rasul\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to wait for extension background page to load: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background.html
from timeout: Timed out receiving message from renderer: 10.000

in the page it opens there is a 3d element that follows the mouse i thought it couldn't render it and turned on the headless browser but that didn't help now i think the problem is in the web driver. I will be glad to any advice. Here is the browser extension that opens the script

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question