擅长:python、mysql、java
<p>您的代码工作得很好,但我更需要包含在'href'元素之后的文本,即'6:00 PM':</p>
<p>所以我这样修改了你的代码:</p>
<pre><code>for td in espn_schedule.find_all('a', {'data-dateformat': 'time1'}):
td.string = td.get('href')
</code></pre>
<p>我成功地找到了我想要的元素,只是我不知道如何在它之后提取文本(即“下午6:00”)。我怎么能做到?</p>