如何从谷歌地图中的推针图像中获取价值

时间:2017-05-22 06:24:29

标签: google-maps selenium google-maps-api-3 webdriver

当我搜索某个地点时,它会在地图指针(覆盖图钉)中显示该位置以及数字,但我想打印/检索该数字。

我无法获取该数字,因为它显示为图像,在HTML页面中没有相应的属性值。请参见下面的屏幕截图:

enter image description here



<div class="gmnoprint" style="width: 26px; height: 43px; overflow: hidden; position: absolute; opacity: 0.01; cursor: pointer; left: 809px; top: 249px; z-index: 291;" title="">
<img style="position: absolute; left: 0px; top: 0px; width: 26px; height: 43px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px; max-width: none;" src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false"/>
</div>
&#13;
&#13;
&#13;

<div class="gmnoprint" style="width: 26px; height: 43px; overflow: hidden; position: absolute; opacity: 0.01; cursor: pointer; left: 809px; top: 249px; z-index: 291;" title="">
<img style="position: absolute; left: 0px; top: 0px; width: 26px; height: 43px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px; max-width: none;" src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false"/>
</div>

1 个答案:

答案 0 :(得分:0)

没有直接获取值的方法,因为它呈现为图像。我们遇到了同样的问题,并要求开发人员不要在QA环境中呈现图像。但问题是页面需要很长时间才能加载。另一种方法是他们给出了一些API来获取它的价值。