擅长:python、mysql、java
<p>您不必处理<code>PageIsReady</code>的值,只需等到具有确切文本内容的<code><script></code>出现在DOM中:</p>
<pre><code>from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, '//script[normalize-space()="var PageIsReady = true;"]')))
</code></pre>