Find Element by xpath in python using selenium Webdriver -
how can find these xpath.
<a class="single_like_button btn3-wrap" onclick="openfblwin_2224175();"> <span> </span><div class="btn3">like</div></a>
and
<button value="1" class="_42ft _4jy0 pagelikebutton _4jy4 _517h _9c6" data-profileid="776072132447222" data-ownerid="u_jsonp_2_t" id="u_jsonp_2_u" type="submit"><i class="_3-8_ img sp_wmp_mjdzgeq sx_96dbd2"></i>like</button>
supposed elements
have class names being unique in tree, can use find_element_by_xpath
.
for a:
find_element_by_xpath('.//a[@class="single_like_button btn3-wrap"]')
and button:
find_element_by_xpath('.//button[@class="_42ft _4jy0 pagelikebutton _4jy4 _517h _9c6"]')
of course can use tree path element, cannot answered due incomplete source.
hope helps.
Comments
Post a Comment