@@ -93,7 +93,7 @@ async function getCompanyList(webContents, sendLog) {
9393 hasNextPage = pageData . hasNext ;
9494 if ( hasNextPage ) {
9595 pageNum ++ ;
96- await waitForNavigation ( webContents , 6000 ) ;
96+ await waitForNavigation ( webContents ) ;
9797 await randomDelay ( 1500 , 2500 ) ;
9898 }
9999 }
@@ -194,7 +194,7 @@ async function voteForCompany(webContents, company, sendLog, skipClick = false,
194194 })()
195195 ` ;
196196
197- const waitNext = waitForNavigation ( webContents , 10000 ) ;
197+ const waitNext = waitForNavigation ( webContents ) ;
198198 const result = await webContents . executeJavaScript ( pageScript ) ;
199199 if ( ! result . success ) throw new Error ( result . reason || '頁面處理失敗' ) ;
200200
@@ -255,7 +255,7 @@ async function searchAndNavigate(webContents, stockCode, sendLog) {
255255
256256 for ( let i = 0 ; i < 20 ; i ++ ) {
257257 await delay ( 500 ) ;
258- const waitSearchNav = waitForNavigation ( webContents , 8000 ) ;
258+ const waitSearchNav = waitForNavigation ( webContents ) ;
259259 const linkResult = await webContents . executeJavaScript ( `
260260 (() => {
261261 const rows = Array.from(document.querySelectorAll('tr')).filter(row => row.innerText.includes('${ stockCode } '));
@@ -311,7 +311,7 @@ async function navigateBackToList(webContents, sendLog) {
311311 })()
312312 ` ;
313313
314- const waitP = waitForNavigation ( webContents , 15000 ) ;
314+ const waitP = waitForNavigation ( webContents ) ;
315315 try {
316316 const clickedBack = await webContents . executeJavaScript ( returnListScript ) ;
317317 if ( ! clickedBack ) {
0 commit comments