Add optional wait time after resolving the challenge before returning (#1046)

Co-authored-by: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com>
This commit is contained in:
Kennedy Oliveira
2025-09-20 00:59:16 -03:00
committed by GitHub
parent d3b1ba6e88
commit d430404de8
3 changed files with 8 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ class V1RequestBase(object):
returnOnlyCookies: bool = None
download: bool = None # deprecated v2.0.0, not used
returnRawHtml: bool = None # deprecated v2.0.0, not used
waitInSeconds: int = None
def __init__(self, _dict):
self.__dict__.update(_dict)

View File

@@ -390,6 +390,11 @@ def _evil_logic(req: V1RequestBase, driver: WebDriver, method: str) -> Challenge
if not req.returnOnlyCookies:
challenge_res.headers = {} # todo: fix, selenium not provides this info
if req.waitInSeconds and req.waitInSeconds > 0:
logging.info("Waiting " + str(req.waitInSeconds) + " seconds before returning the response...")
time.sleep(req.waitInSeconds)
challenge_res.response = driver.page_source
res.result = challenge_res