遇到一個 driver.execute_async_script(“…”) 的時候, 如果使用者點擊網頁上的其他超連結, 會造成 main thread 被卡住的問題.
set_script_timeout(time_to_wait: float) → None
Set the amount of time that the script should wait during an execute_async_script call before throwing an error.
| Args: | time_to_wait: The amount of time to wait (in seconds) | 
|---|---|
| Usage: | driver.set_script_timeout(30) | 
Example:
driver.set_script_timeout(3)