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' 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()