s = """
<tbody>
<tr>
<td style="border-bottom: none">
<span class="graytext" style="font-weight: bold;"> Reply #3 - </span>
<span class="graytext" style="font-size: 11px">
05/13/09 2:02am
<br>
</span>
</td>
</tr>
</tbody>
"""
在 HTML 字符串中,我需要取出日期字符串。
我试过这样
import lxml
doc = lxml.html.fromstring(s)
doc.xpath('//span[@class="graytext" and @style="font-size: 11px"]')
但这不起作用。我应该只需要日期字符串。