Given below is the snippet of HTML:
<div class="a-row a-spacing-none">
<span class="a-size-small a-color-secondary">by
</span>
<span class="a-size-small a-color-secondary">
<a class="a-link-normal a-text-normal" href="/Lowell-Fryman/e/B01M3MNJTE/ref=sr_ntt_srch_lnk_1?qid=1550228622&sr=1-1">
Lowell Fryman
</a>
and
</span>
<span class="a-size-small a-color-secondary">
<a class="a-link-normal a-text-normal" href="/Gregory-Lampshire/e/B01N7ZWT5Y/ref=sr_ntt_srch_lnk_1?qid=1550228622&sr=1-1">
Gregory Lampshire
</a>
</span>
</div>
I'm trying to obtain the name of all authors.
This is whatever test follows the word by
.
I came up with the following XPath but it doesn't seem to fetch all the authors.
My XPath expression:
//div//span[text()=\"by \"]//following::span[1]//a
Can someone please tell me how to obtain the name of all the authors while somehow managing to skip any element whose text is "and"?
I'm using Selenium's find_element_by_xpath
if it helps.