R
R
resresres2021-07-30 09:32:58
Python
resresres, 2021-07-30 09:32:58

chrome extension not working with selenium what to do?

Good afternoon, I want to open the MetaMask extension using selenium, but after opening, 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

For the test, I put another extension in place of MetaMask and it worked, but I need to use MetaMask
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')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Znoleg, 2021-12-27
@Znoleg

Hello, did you solve the problem?

B
Bla Bla, 2022-04-06
@SubUser

And how is the problem solved?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question