gpt4 book ai didi

python - 为 Microsoft Edge 使用 python selenium

转载 作者:行者123 更新时间:2023-12-04 01:05:00 25 4
gpt4 key购买 nike

我正在尝试将 pythons selenium 用于 Microsoft Edge,但我不断收到此错误:

WebDriverException: Message: unknown error: cannot find Microsoft Edge binary

我下载了最新版本的边缘驱动程序。这是我的代码:
from selenium import webdriver
from selenium.webdriver.remote import webelement
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
import pandas as pd
import time
from bs4 import BeautifulSoup
import os
from datetime import datetime
from selenium.webdriver import ActionChains

driver = webdriver.Edge(executable_path = 'C:\\Users\\Downloads\\edgedriver_win32\\msedgedriver.exe')
def get_trulia_estimate(address):
driver.get('https://www.trulia.com/')
print(address)
element = (By.ID, 'homepageSearchBoxTextInput')

WebDriverWait(driver, 10).until(EC.element_to_be_clickable(element)).click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable(element)).send_keys(address)

search_button = (By.CSS_SELECTOR, "button[data-auto-test-id='searchButton']")

WebDriverWait(driver, 50).until(EC.element_to_be_clickable(search_button)).click()

time.sleep(3)

最佳答案

WebDriver 找不到您的 MS Edge 路径,您可以尝试卸载并重新安装 Edge。
如果它不会帮助将边缘位置添加到您的系统路径或使用 --binary 参数。

关于python - 为 Microsoft Edge 使用 python selenium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57169524/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com