python - 对如何迭代这个 xpath 感到困惑
问题描述
我正在遍历一个 JSON 文件并将其内容同时粘贴到网站上的文本编辑器上。
incrementor = 1
for x in range(len(jsonL)):
jsonL[x]["question"] = jsonL[x]["question"].strip()
if incrementor//2 != 1:
element = browser.find_element_by_xpath(f'//div[contains(@title, "Rich Text Editor,
editor{incrementor}")]')
element.send_keys(jsonL[x]["question"])
incrementor += 1
在下一次迭代中,我想要
element.send_keys(jsonL[x][choices[0]])
我怎样才能做到这一点?
解决方案
推荐阅读
- reactjs - 矩形发布请求
- swift - 在 UILongPressGestureRecognizer 中的 .state == .began 末尾触发不需要的“CANCEL”事件
- json - 将核心数据条目标记为收藏夹 SWIFTUI
- c++ - 如何在命令设计模式中处理多个接收器和多个命令?
- r - R 中 4.0.4 版本的匹配函数
- javascript - 导航手机无法打开(mobile-nav-toggle)
- javascript - 如何在打字稿中使用库
- c# - 发布到 Teams webhook 时 AdaptiveCard 400 错误请求 C#
- python - 使用 plotly-dash 为 pandas 数据框绘制交互式图形会引发回调错误更新输出
- html - 做什么
% 以 CSS 长度表示,例如 100%25