<button _ngcontent-c50="" class="mat-menu-item ng-star-inserted" mat-menu-item="" role="menuitem" tabindex="0" aria-disabled="false"> 11 - teste <div class="mat-menu-ripple mat-ripple" matripple=""></div></button>
代码水豚, 经过测试
browser.find('button', text: ' 11 - teste ').click
find_button(' 11 - teste ')
find('#button.mat-menu-item').click
答案 0 :(得分:1)
有了该HTML,您应该就可以使用
import pygame
finish = False
while not finish:
for event in pygame.event.get():
if event.type == pygame.QUIT:
finish = True
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP:
print "A"
if event.key == pygame.K_RIGHT:
print "B"
if event.key == pygame.K_LEFT:
print "C"
如果没有提供确切的错误消息,您会得到
答案 1 :(得分:0)
您是否尝试过使用指定的文本明确查找按钮?
parse_str(str_replace(PHP_EOL, '&', $data), $result);
根据您的水豚版本,您还可以指定搜索是否不完全
find('button', text: '11 - teste')