以下面的代码为例,把变量checkName放到字符串“//span[text()='" + checkName + "']/../../span/a”中 具体格式就是:'" + checkName + "'
checkName = json_data['检查项名'] self.driver.find_elements_by_xpath("//span[text()='" + checkName + "']/../../span/a")[0].click()