0

I used Google Collab and browser Edge and i tried this code with selenuim:

!wget  -O 'edgedriver_win64.zip' -q 
'https://msedgedriver.azureedge.net/96.0.1054.57/edgedriver_win64.zip'
!unzip '/content/edgedriver_win64.zip'

import selenium
from selenium import webdriver
wd = webdriver.Edge('/content/msedgedriver.exe')

and i had this error:

/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:3: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  This is separate from the ipykernel package so we can avoid doing imports until
---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in start(self)
     75                                             stdin=PIPE,
---> 76                                             creationflags=self.creationflags)
     77         except TypeError:

5 frames
PermissionError: [Errno 13] Permission denied: '/content/msedgedriver.exe'

During handling of the above exception, another exception occurred:

WebDriverException                        Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in start(self)
     86                 raise WebDriverException(
     87                     "'%s' executable may have wrong permissions. %s" % (
---> 88                         os.path.basename(self.path), self.start_error_message)
     89                 )
     90             else:

WebDriverException: Message: 'msedgedriver.exe' executable may have wrong permissions. Please download from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

But I have already downloaded last version Edge driver by !wget before and i have no idea how can i fixed it because all solutions on Stack Overflow were for Chrome Driver and they didn't work for me.

F1nn
  • 3
  • 2
  • Hi @F1nn How about the issue? Is [my answer below](https://stackoverflow.com/questions/70395665/webdriverexception-message-msedgedriver-exe-executable-may-have-wrong-permis/70418228#70418228) helpful to deal with the issue? Please let me know if there is anything that I can help here. – Yu Zhou Dec 22 '21 at 07:29

1 Answers1

0

Edge and Chrome are both based on chromium so you can refer to the code for Chrome driver.

Google Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. The entire colab runs in a cloud VM. The current colab notebook is running on top of Ubuntu 18.04.3 LTS.

If the OS is Linux, when you're specifying the msedgedriver binary path you don't need to provide any extension for the executable binary. The sample code is like this:

wd = webdriver.Edge('/content/msedgedriver')

Reference link: WebDriverException: Message: 'chromedriver.exe' executable may have wrong permissions using Google Colaboratory through Selenium Python

Yu Zhou
  • 11,532
  • 1
  • 8
  • 22
  • My OS is Windows 10, so if the current colab laptop runs on top of Ubuntu 18.04.3 LTS, then for which OS do I need to download msedgedriver using !wget, for Linux? – F1nn Dec 23 '21 at 11:36
  • You should download `edgedriver_linux64.zip`. If you're running the test on Google Colaboratory, it has nothing to do with your OS. Also you should install correct version of Edge browser for Linux on the Google Colaboratory cloud VM. The Edge driver version should be the same as the browser version. – Yu Zhou Dec 24 '21 at 03:07