Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyjpboatrace/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 9 additions & 3 deletions pyjpboatrace/operator/better.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'))
)
Comment on lines 162 to +179

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters the Selenium calls made by __bet (switching the submit click from By.CLASS_NAME, 'btnSubmit' to a CSS selector, and adding a WebDriverWait that will call find_element(By.ID, 'pass')). The unit test tests/operator/test_better.py::test_betting_operator_do currently asserts the old (By.CLASS_NAME, 'btnSubmit') call and the previous call order, so it will fail unless updated to expect the new selector and the additional pass lookup triggered by the wait.

Copilot uses AI. Check for mistakes.
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()
Expand Down