I am trying to store the friend list of a Facebook ID. When I click on the Friends tab on the profile, the friend list should be opened if it's not blocked; otherwise, something else should open.
To determine if the friend list is opened or blocked, I select the element that is present when the friend list is opened:
try:
WebDriverWait(browser, 4).until(EC.presence_of_element_located((By.PARTIAL_LINK_TEXT,"friends_all")))
except:
print "Friend list is blocked"
browser.close()
The HTML code of the element in question is:
<a class="_3c_ _3s-" href="https://www.facebook.com/tripti.vishnoiji/friends_all" aria-controls="pagelet_timeline_app_collection_100001042287600:2356318349:2" role="tab" aria-selected="true" name="All friends" id="u_jsonp_2_0">
<span class="_3sz">All friends</span>
<span class="_3d0"></span>
<div class="_3s_"></div>
</a>
The output currently displayed is: friend list is blocked
I am puzzled as to why the element is not being selected.