擅长:python、mysql、java
<p>对于多个返回记录:</p>
<pre><code>driver.get("http://www.hotleathers.com/Front-Printed-T-Shirts-C1232.aspx?s=OrderBy%20ASC&&v=all")
returnText = []
returnText = self.driver.execute_script("var iterator = document.evaluate(\"//span[@class='tableNode']/text()[preceding-sibling::br and following-sibling::br]\", document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); var arrayXpath = new Array(); var thisNode = iterator.iterateNext(); while (thisNode) {arrayXpath.push(thisNode.textContent); thisNode = iterator.iterateNext(); } return arrayXpath;")
for item in returnText:
print item
</code></pre>
<p>纯Javascript代码是:</p>
^{pr2}$