你好
我正试着写我的第一个网络垃圾。我设法写了以下内容:
import requests
from bs4 import BeautifulSoup
s = requests.Session()
r = s.get("http://www.sharenet.co.za/v3/quickshare.php?scode=BTI")
r = s.post("http://www.sharenet.co.za/v3/quickshare.php?scode=BTI")
soup = BeautifulSoup(r.text, "html.parser")
print(soup.find_all("td", class_="dataCell"))
我正试图提取一个股价。检查元素时,这是HTML代码:
<td class="dataCell" align="right">85221</td>
基本上,我的问题是,可以搜索所有的标签,但不能提取确切的标签我想要的。你知道吗
提前谢谢你的帮助。你知道吗
标记有一个
get_text()
方法。find_all
返回标记列表。你知道吗相关问题 更多 >
编程相关推荐