python+selenium如何获取元素中并列的属性值

2024-11-06 21:24:22
推荐回答(1个)
回答1:

element = driver.find_element_by_xpath("//*[@id='lobby-left-container']/div[2]/div/table/tbody/tr[1]/td[2]/div")

data_id = element.get_attribute("data-id")