From c970307e060b9d7b702a905e80d0ddb66de44e00 Mon Sep 17 00:00:00 2001 From: nishimaki Date: Wed, 15 Apr 2026 08:43:12 +0900 Subject: [PATCH 1/2] fix: update IBMBRACEORJP to .xhtml to follow site drift boatrace.jp migrated the vote bridge endpoint from VoteBridgeNew.jsp to VoteBridgeNew.xhtml (JSF). The old URL now redirects to a SP error page (sp/ibm/sliphttp/signless.jsp), causing TimeoutException in get_bet_limit() and the entire betting flow. Verified with get_bet_limit() returning a numeric balance on the real site. Login form, currentBetLimitAmount element, and PC flow are otherwise unchanged. --- pyjpboatrace/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyjpboatrace/const.py b/pyjpboatrace/const.py index 5aac5fc..711956e 100644 --- a/pyjpboatrace/const.py +++ b/pyjpboatrace/const.py @@ -12,7 +12,7 @@ IBMBRACEORJP = ''.join([ f'{BOATRACEJP_MAIN_URL}', - 'owpc/VoteBridgeNew.jsp?', + 'owpc/VoteBridgeNew.xhtml?', 'param=H0JS00000stContens' '&kbn=1' '&voteActionUrl=/owpc/pc/site/index.html' From 22a05a9bdad2b72890517141bb8809a5499b5b30 Mon Sep 17 00:00:00 2001 From: nishimaki Date: Wed, 15 Apr 2026 19:39:00 +0900 Subject: [PATCH 2/2] fix: scope btnSubmit selector to .inputCompletion to avoid stray clicks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bare `By.CLASS_NAME, 'btnSubmit'` matched hidden `btnSubmit` elements belonging to password-change sub-forms (`
  • `) before the real "投票入力完了" button (`
    `). As a result the vote flow silently failed to navigate to the confirmation page, and the following `find_element(By.ID, 'pass')` raised NoSuchElementException. Fix: - Use `By.CSS_SELECTOR, '.inputCompletion .btnSubmit a'` to target the correct button unambiguously. - Wait for `id=pass` on the confirmation page with WebDriverWait to tolerate the navigation delay. Verified against the live site with a real 100-yen trifecta bet: the balance decreased by 100 yen and the bet appeared in the vote history. --- pyjpboatrace/operator/better.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyjpboatrace/operator/better.py b/pyjpboatrace/operator/better.py index 8199ebb..57459e1 100644 --- a/pyjpboatrace/operator/better.py +++ b/pyjpboatrace/operator/better.py @@ -159,8 +159,11 @@ def __bet( amount = amount + amt - # complete input - self._driver.find_element(By.CLASS_NAME, 'btnSubmit').click() + # complete input (target the "投票入力完了" button inside .inputCompletion; + # plain CLASS_NAME 'btnSubmit' also matches hidden password-change forms) + self._driver.find_element( + By.CSS_SELECTOR, '.inputCompletion .btnSubmit a' + ).click() # insufficient depost if amount > limit: @@ -170,7 +173,10 @@ def __bet( f'but your current deposit is {limit}.' ) - # confirmation + # confirmation page — wait for the betconf DOM to appear + WebDriverWait(self._driver, timeout).until( + EC.presence_of_element_located((By.ID, 'pass')) + ) self._driver.find_element(By.ID, 'amount').send_keys(str(amount)) self._driver.find_element(By.ID, 'pass').send_keys(self._user.vote_pass) # noqa self._driver.find_element(By.ID, 'submitBet').click()