使用selenium工具查找xpath

时间:2014-03-27 11:05:28

标签: xpath

我需要在下面给出的代码中找出一个元素的xpath:

<div class="fbTimelineSection mtm fbTimelineTopSection">
<div id="fbProfileCover" class="drop_elem">
<div id="u_jsonp_2_0" class="cover">
<div id="fbTimelineHeadline" class="clearfix">
<div class="_50zj">
<div class="_70k">
<div id="u_jsonp_2_2" class="_6_7 clearfix" data-referrer="timeline_light_nav_top">
<a class="_6-6 _6-7" href="https://www.facebook.com/memusipra">
<a class="_6-6" data-medley-id="pagelet_timeline_medley_about" href="https://www.facebook.com/memusipra/about">
<a class="_6-6" data-medley-id="pagelet_timeline_medley_photos" href="https://www.facebook.com/memusipra/photos">
<a class="_6-6" data-medley-id="pagelet_timeline_medley_friends" href="https://www.facebook.com/memusipra/friends">
<div id="u_jsonp_2_3" class="_6a uiPopover _6-6 _9rx">
</div>

我需要找到Xpath:

<a class="_6-6" data-medley-id="pagelet_timeline_medley_friends" href="https://www.facebook.com/memusipra/friends">

1 个答案:

答案 0 :(得分:1)

使用以下查询:

xpath=//a[@data-medley-id="pagelet_timeline_medley_friends"]
相关问题