xpath中没有提供对class的原生查找方法.但是 stackoverflow 看到了一个很有才的回答: This selector should work but will be more efficient if you replace it with your suited markup:这个表达式应该是可行的.不过如果你把class换成更好识别的标识执行效率会更高 //*[contains(@class, 'Test')] But since this will also match
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><h