I was originally asking for a sort of combination for empty style and ::before css, but it seems the css is not recognizable by Selenium.
So I am posting a larger piece of the html and asking for another combination: style empty and text followed by style. Which would be style="">Full Access<
This is extended html:
<span class="highwire-citation-access highwire-citation-access-check" data-pisa-id="sci;science.aav1483" data-atom-uri="/sci/363/6422/eaav1483.atom" data-request-view="full">
<i class="highwire-access-icon highwire-access-icon-user-access user-access fa fa-unlock-alt" title="Full Access" aria-hidden="true" style=""></i>
<span class="element-invisible highwire-access-icon highwire-access-icon-user-access" style="">Full Access</span>
<i class="highwire-access-icon highwire-access-icon-no-access no-access fa fa-lock" title="Restricted Access" aria-hidden="true" style="display:none;"></i>
<span class="element-invisible highwire-access-icon highwire-access-icon-no-access" style="display:none;">Restricted Access</span></span>
<i class="highwire-access-icon highwire-access-icon-user-access user-access fa fa-unlock-alt" title="Full Access" aria-hidden="true" style=""></i>
<span class="element-invisible highwire-access-icon highwire-access-icon-user-access" style="">Full Access</span>
<i class="highwire-access-icon highwire-access-icon-no-access no-access fa fa-lock" title="Restricted Access" aria-hidden="true" style="display:none;"></i>
<span class="element-invisible highwire-access-icon highwire-access-icon-no-access" style="display:none;">Restricted Access</span>
The python relevant code:
child = browser.find_elements(By.XPATH,(" %s" % exp))
for t in child:
verbose = t.get_attribute('innerHTML')
Right now the expression %s is replaced by the xpath:
"//*[(@style='""')]/../../*"
And the results are both Full Access and Restricted Access elements.