You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our example target is this <p>We are currently looking at a node with a<b> child node </b>within it.</p>, and we would use .//p/descendant-or-self::text() to catch anything between <p> and </p>;
Once we would print list, we would see [u'We are currently looking at a node with a ', u'child node', u' within it.', u'.'];
This means that list[0] contains We are currently looking at a node with a, list[1] contains child node, and list[2] contains within it.;
list
content
list[0]
We are currently looking at a node with a
list[1]
child node
list[2]
within it.
By obtaining only list[0], we would corrupt the desired XPath result by outputing only the content between the first <p> and the first <b>.
Consider using method
str.join(iterable)
.Here is where the problem currently relies.
Our example target is this
<p>We are currently looking at a node with a<b> child node </b>within it.</p>
, and we would use.//p/descendant-or-self::text()
to catch anything between<p>
and</p>
;Once we would print
list
, we would see[u'We are currently looking at a node with a ', u'child node', u' within it.', u'.'];
This means that
list[0]
contains We are currently looking at a node with a,list[1]
contains child node, andlist[2]
contains within it.;list[0]
list[1]
list[2]
By obtaining only
list[0]
, we would corrupt the desired XPath result by outputing only the content between the first<p>
and the first<b>
.This also significantly hardens the use of XPath String Functions such as substring-before, substring-after and substring, and may require us to make an excessive use of
for
loops, considering the functions that XPath already provides.The text was updated successfully, but these errors were encountered: