Make navigate_to_url idempotent (#3705)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8f15880a6d
commit
ff4a2c982b
@@ -680,6 +680,8 @@ class BrowserState:
|
||||
await self.navigate_to_url(page=page, url=url)
|
||||
|
||||
async def navigate_to_url(self, page: Page, url: str, retry_times: int = NAVIGATION_MAX_RETRY_TIME) -> None:
|
||||
if page.url.rstrip("/") == url.rstrip("/"):
|
||||
return
|
||||
try:
|
||||
for retry_time in range(retry_times):
|
||||
LOG.info(f"Trying to navigate to {url} and waiting for 1 second.", url=url, retry_time=retry_time)
|
||||
|
||||
Reference in New Issue
Block a user