我们如何找到ttl=”的值;系列:客户数量,类别:东南,价值:10000,来自使用selenium的HTML

我们如何找到ttl=”的值;系列:客户数量,类别:东南,价值:10000,来自使用selenium的HTML,selenium,selenium-webdriver,microstrategy,Selenium,Selenium Webdriver,Microstrategy,我想确定该子级属于多个具有相同类名mstrmojo DocXtabGraph的div 例1。ttl=“系列:客户数量类别:东南价值:10000 2.ttl=“Series:2016年营业收入平均值类别:东南价值:$883605%类别: <div id="*lK34*kW55*x1*t1494834294905" class="mstrmojo-DocXtabGraph " style="background-color: rgb(255, 255, 255); border: 1pt

我想确定该子级属于多个具有相同类名mstrmojo DocXtabGraph的div 例1。ttl=“系列:客户数量
类别:东南
价值:10000 2.ttl=“Series:2016年营业收入平均值
类别:东南
价值:$883605
%类别:

   <div id="*lK34*kW55*x1*t1494834294905" class="mstrmojo-DocXtabGraph " style="background-color: rgb(255, 255, 255); border: 1pt solid rgb(206, 206, 206); width: 614px; height: 354px; left: 34px; top: 175px; z-index: 7; display: block;">
<div class="mstrmojo-DocXtabGraph-txt" style="display: none;"></div>
<img class="mstrmojo-DocXtabGraph " usemap="#*lK34*kW55*x1*t1494834294905_map4" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmYAAAFiCAYAAABcVRQBAAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH4QUPBy0Eo0d10gAAFRZJREFUeJzt3b/LG3l+B3A9wc1u3OgfeKot0mwgpBBpj4OL4QgO1xwLJj/YzuTAYAWiQAwOqIgacyGVl1xCYDkXBymuXAxXBRXBkCqsly0eME9xhcrANpPiGO94npnRzGhmvp+RXi8wK331nfl+9CDt963vjEZXWZZlCwAAkvu91AUAAPA7ghkAQBCCGQBAEIIZAEAQghkAQBCCGQBAEIIZAEAQghkAQBCCGQBAEIIZAEAQghkAQBCCGQBAEPf6bLRerxe73e5OW6782LE+XdsB4JjyXGWuYRayjp4+fZo9ffr0TlvT/aY+XdsB4JjyXGWuYS46HcqsWimr4hMHAKm0nasgok6HMpte6JaCAQBO0+scsyrl4/VThLNvv/12ce/eYE8Bg...5g7hzKBAAIQjADAAgi7KHMNj7++OPFfr+fdMy/+9HvTzrepH7096krGMWnqQsY0aefp65gPH+auoARTf3/rXP20UcfpS4BBjXrYPbpp+c85QIAl8ahTACAIK6yLMtSF1HHV54B6MrcwZyFDmYAAJfEoUwAgCAEMxjZer3+4N8p+6m6PYax9w9AtVl/KxOiq7rquCuRA1BHMIOJlX8uptxe9ZMyxdtVjx3bZ5f2/L4ACZBABozq6dOn2dOnTyvbq+63aS/vs8u2fdoBmIYVMxhZcSWseH+o/ZZVnR9WXAmra9/tdlbIABITzGAidYcqxxqnqOnw6FR1AXCcb2XCiE79duMY29d9u7NuVQ2A6VgxgxFVhZ18Var8WFV7uc+xVa2u+6zr32YsAIbnyv8AAEE4lAkAEIRgBgAQhGAGABCEYAYAEIRgBgAQhGAGABCEYAYAEIRgBgAQhGAGABCEYAYAEIRgBgAQxP8DAGsjaGrEe+gAAAAASUVORK5CYII=" hidefocus="true" style="display: block; background: transparent none repeat scroll 0% 0%;">
<map id="*lK34*kW55*x1*t1494834294905_map4" name="*lK34*kW55*x1*t1494834294905_map4">
<area shape="rect" coords="350,328,405,328" ttl="Series: Last Month's Order Count<br/>Category: Southeast<br/>Value: 9,948" aid="0" onclick="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onClickArea(this, event);" oncontextmenu="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onContextMenu(this, event);" onmousemove="mstrmojo.all['*lK34*kW55*x1*t1494834294905']._updateTooltip(event, self);">
<area shape="rect" coords="295,325,350,328" ttl="Series: Employee Headcount<br/>Category: Southeast<br/>Value: 4" aid="1" onclick="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onClickArea(this, event);" oncontextmenu="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onContextMenu(this, event);" onmousemove="mstrmojo.all['*lK34*kW55*x1*t1494834294905']._updateTooltip(event, self);">
<area shape="rect" coords="241,135,295,328" ttl="Series: Order Count<br/>Category: Southeast<br/>Value: 9,948" aid="2" onclick="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onClickArea(this, event);" oncontextmenu="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onContextMenu(this, event);" onmousemove="mstrmojo.all['*lK34*kW55*x1*t1494834294905']._updateTooltip(event, self);">
<area shape="rect" coords="186,48,241,328" ttl="Series: Item Count<br/>Category: Southeast<br/>Value: 360" aid="3" onclick="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onClickArea(this, event);" oncontextmenu="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onContextMenu(this, event);" onmousemove="mstrmojo.all['*lK34*kW55*x1*t1494834294905']._updateTooltip(event, self);">
<area shape="rect" coords="131,153,186,328" ttl="Series: Count Order shipped within 5 days<br/>Category: Southeast<br/>Value: 9034" aid="4" onclick="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onClickArea(this, event);" oncontextmenu="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onContextMenu(this, event);" onmousemove="mstrmojo.all['*lK34*kW55*x1*t1494834294905']._updateTooltip(event, self);">
<area shape="rect" coords="76,134,131,328" ttl="Series: Count of Customers<br/>Category: Southeast<br/>Value: 10,000" aid="5" onclick="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onClickArea(this, event);" oncontextmenu="mstrmojo.all['*lK34*kW55*x1*t1494834294905'].onContextMenu(this, event);" onmousemove="mstrmojo.all['*lK34*kW55*x1*t1494834294905']._updateTooltip(event, self);">
</map>
</div>

尝试以下操作,使用dcssSelector标识元素,然后提取“ttl”属性:

  driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl");
**更新:**

  String[] data = driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl").split("<br/>");

你看到了什么错误?您还可以使用actions类'moveToElement()方法获取如下错误无此类元素:无法定位元素:{“方法”:“css选择器”,“选择器”:“div.mstrmojo-DocXtabGraph映射区域[coords*='76134131328']”(会话信息:chrome=58.0.3029.110)@Kushal:(驱动程序信息:chromedriver=2.29.461591(62ebf098771772160f391d75e589dc567915b233),平台=Windows NT 6.3.9600 x8664)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时时间:10.07秒确保您的元素不在iFrame中我看不到任何iFrame标记我获得了ttl=Series:Count of Customers
Category:Southern
值:10000但我需要所有值,如Series:Count of Customers,Southern和10000 seprately
 driver.findElement(By.cssSlector("div:nth-child(2) map area:nth-child(6)")).getAttribute("ttl");