We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acefc09 commit 6a7152aCopy full SHA for 6a7152a
botcity/web/browsers/undetected_chrome.py
@@ -138,9 +138,11 @@ def wait_for_downloads(driver):
138
"""
139
if not driver.current_url.startswith("chrome://downloads"):
140
driver.get("chrome://downloads/")
141
+ # Chrome changed the `e.state` from a ENUM Str to numbers. Here 2 means COMPLETE.
142
+ # Reference: https://shorturl.at/G4EES
143
return driver.execute_script("""
144
var items = document.querySelector('downloads-manager')
145
.shadowRoot.getElementById('downloadsList').items;
- if (items.every(e => e.state === "COMPLETE"))
146
+ if (items.every(e => e.state === 2))
147
return items.map(e => e.fileUrl || e.file_url);
148
""")
0 commit comments