程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python| (solution) apple mac cannot open chromedriver because the developer cannot be verified. How to solve this problem?

編輯:Python

Preface

We work , Many friends use Windows System computer , But some of my friends still use apple mac The computer ,Windows The system computer will not be detailed here , Today, let's talk about using apples mac The computer encountered about using selenium The problem of . I don't say much nonsense , Follow Xiaobian to get to the point .

solve Apple mac The computer cannot be turned on ‘chromedriver’, Because you can't verify the developer

When the apple computer is installed chromedriver After driving , Use selenium Open Google browser , You will encounter the following problems , The picture is as follows :

  terms of settlement :

First you need to find the installation chromedriver The absolute path of the drive

for instance , My path here is :/Users/edy/Desktop/rich/webdriver/chromedriver

What we need to do now is to bypass Apple's permission , Need to switch to chromedriver Execute under directory

First step , Open it directly pycharm Terminal , Enter the following command , And press enter

cd /Users/edy/Desktop/rich/webdriver

The second step , Continue to input the following commands at the terminal , And press enter

xattr -d com.apple.quarantine chromedriver

Next , We are pycharm Execute the following code in :

from selenium import webdriver
path = r'/Users/edy/Desktop/rich/webdriver/chromedriver'
url = 'https://www.baidu.com'
driver = webdriver.Chrome(path)
driver.get(url)

After successful operation , You'll find that , Your apple mac The computer can be used normally selenium Open Google Chrome .

If you like this article or it helps you , Remember to pay attention to Xiaobian and point a praise , If you have any questions or needs, please leave a message or send a private letter .

Python| How to install it correctly PaddleOCR


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved