如何从 table 中获取元素,以在编剧 python 中被选中

how to get element from a table, to be selected in playwright python

例如,它通过了 'ids',但我只想从包含描述 'Edição 993 link direto gdb' 和下一个的 table 下载。 我试着用 page.inner_html("tbody") 带来它,但我是 python 的新手,一般来说,你对我能做些什么有什么建议吗?

要获取 id,您需要父级,并评估 id 属性

const td = page.locator("text=Edição 993 link direto gdb");
const tr = await td.$('xpath=..')
const id = await tr.evaluate(node => node.getAttribute('id'))