Skip to content

Commit

Permalink
更新自动点弹题答案的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
jethroCup committed Mar 30, 2019
1 parent 4f05ddb commit 85adfaa
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ ENV/
# mypy

.mypy_cache/
ʹÓÃ˵Ã÷.mp4
/ʹÓÃ˵Ã÷.mp4
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 24 additions & 7 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions web.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,25 @@ def check_end():
if "playButton" in playBtn.get_attribute("class"):
return True


def close_tanti():
try:
nextButton = browser.find_element_by_xpath('//a[@class="popbtn_cancel"]')
time.sleep(3)
nextButton.click()
return True
except:
ele = browser.find_element_by_id('tmDialog_iframe')
if ele:
print(time.strftime("[%H:%M] ")+'检测到弹题')
browser.switch_to_frame(ele)
time.sleep(2)
divs = browser.find_elements_by_xpath('//div[@class="answerOption"]/label/input')
divs[1].click()
print(time.strftime("[%H:%M] ")+'已点击第二个答案')
browser.switch_to_default_content()
nextButton = browser.find_element_by_xpath('//a[@class="popbtn_cancel"]')
time.sleep(2)
nextButton.click()
return True
else:
return False
except Exception as e:
print(e)
return False


Expand Down
Binary file added 使用说明.mp4
Binary file not shown.

0 comments on commit 85adfaa

Please sign in to comment.