使用Python抓取图像链接

使用Python抓取图像链接,python,selenium,Python,Selenium,这是我的密码 from selenium import webdriver chrome_options = webdriver.ChromeOptions(); chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']); options = webdriver.Chrome(options=chrome_options) options.get('https://www.google.co

这是我的密码

from selenium import webdriver
chrome_options = webdriver.ChromeOptions(); 
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']);
options = webdriver.Chrome(options=chrome_options)
options.get('https://www.google.com/')
images = options.find_elements_by_tag_name('img')
for image in images:
    print(image.get_attribute('src'))
options.close()
当我运行这段代码时,我得到了这个错误

**Traceback (most recent call last):
Python\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "Python\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "Python\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified**
请检查我是否在代码中犯了任何错误,或者您是否理解此错误,请务必让我知道
谢谢

在声明驱动程序时,您需要向chrome驱动程序添加路径

driver = webdriver.Chrome(options=chrome_options, executable_path=r"C:\path\to\chromedriver.exe")

首先从下载并安装浏览器驱动程序 解压缩并将其放入类似browserdriver的目录中,然后按如下方式更改代码:

from  selenium import webdriver
browser = webdriver.Chrome(r"C:\browserdriver\chromedriver.exe")
browser.get("http://www.google.com")


请将此问题标记为已解决,任何一个答案都可以。