【发布时间】:2020-04-29 08:46:39
【问题描述】:
html代码是
<td>
<i class="fas fa-arrow-down arrow-green"></i>
<span class="fs_buy">Strong Buy</span>
1.11
</td>
如果我使用此代码
cccss ='//*[@id="fs_title_values"]/div[3]/table/tbody/tr[1]/td[5]'
about = driver.find_element_by_xpath(cccss)
RatingCurrentValue=about.text
print ('RatingCurrentValue', RatingCurrentValue)
我会得到所有文本:RatingCurrentValue Strong Buy 1.11
我的目标是只得到 1.11 没有 span 标签中的文本。
请帮帮我。
【问题讨论】:
标签: python html selenium html-table