所以我试图从find_element搜索中提取某些数据

quest1 = browser.find_element_by_id("a29081363")
quest1.title = browser.find_element_by_class_name("title").text
quest1.desc = browser.find_element_by_class_name("desc").text
quest1.progress = browser.find_element_by_class_name("progress").text


如何仅在“ quest1”的数据而不是整个网站中搜索标题,说明和进度?

最佳答案

find_element_by_* element而不是quest1上调用browser方法:

title = quest1.find_element_by_class_name("title").text
desc = quest1.find_element_by_class_name("desc").text
progress = quest1.find_element_by_class_name("progress").text

10-04 22:17