You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Selenium执行execute_script报unknown error: call function result missing 'value'求助

Fixing "unknown error: call function result missing 'value'" in Selenium with ChromeDriver

Hey there! I’ve run into this exact error before, so let’s break down how to fix it step by step.

First, let’s get to the root cause: your ChromeDriver version doesn’t match your Chrome browser version—this is the most common trigger for this error. Here’s what you need to do:

1. Match ChromeDriver to your Chrome version

Your Chrome is version 65.0.3325.162, but you’re using ChromeDriver 2.33—this is a clear mismatch. ChromeDriver 2.33 only supports Chrome versions 60-62. For Chrome 65, you need ChromeDriver 2.36 (it’s explicitly built to support Chrome 65-67).

  • Download the correct ChromeDriver version for your Mac OS X system.
  • Replace your existing chromedriver executable with the new one. Make sure your code points to the right path (or update your system PATH to include the new driver’s location).

2. Fix the execute_script syntax

Your current scroll code uses string formatting, which can sometimes cause unexpected issues with how the script executes. Instead of string concatenation, pass the scroll position as an argument to execute_script—this is the safer, recommended approach:

# Replace your current line with this
driver.execute_script('window.scrollTo(0, arguments[0]);', scr)

This avoids potential syntax errors from direct string formatting and ensures the value is passed correctly to the JavaScript function.

3. Additional checks

  • Make sure your Selenium library is up to date. Older versions might have compatibility issues with newer ChromeDriver releases.
  • Restart your browser and test script—sometimes stale sessions or cached data can cause weird errors like this.
  • Double-check that scr holds a valid numeric value (not a string or undefined) before passing it to the scroll function.

Bonus note about the Send Keys error

Since you mentioned this error also popped up with Send Keys after upgrading ChromeDriver, fixing the version mismatch should resolve that issue too—most interaction errors in Selenium stem from driver-browser version incompatibility.

内容的提问来源于stack exchange,提问作者buzz11

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:26:59