【发布时间】:2021-09-30 14:33:09
【问题描述】:
我有以下代码块:
Game_names = ['Game1', 'Game2', 'Game3', 'Game4', 'Game5']
for i in driver.find_elements_by_id("com.project.ProjectName:id/itemContainer"):
for title in i.find_elements_by_id("com.project.ProjectName:id/title"):
print('Game titles are: ' + title.text)
if Game_names == title.text:
print('Games titles are correct')
else:
print('Games titles are not correct')
我需要检查游戏名称是否正确。
谁能帮我解决这个问题?提前致谢。
【问题讨论】:
-
预期输出是什么?请将其添加到您的帖子中。
-
你要检查
title.text是否在列表中Game_names -
嗨,~输出:游戏标题是:Game1 Game2 ... 游戏标题是正确的
标签: python android selenium loops selenium-webdriver