【发布时间】:2020-02-28 18:02:00
【问题描述】:
我目前正在运行此代码:
import urllib
from bs4 import BeautifulSoup
htmltext = urllib.urlopen("http://www.fifacoin.com/")
html = htmltext.read()
soup = BeautifulSoup(html)
for item in soup.find_all('tr', {'data-price': True}):
print(item['data-price'])
当我运行此代码时,我根本没有得到任何输出,当我知道该特定网站上有带有这些搜索参数的 html 标记时。我可能在这里犯了一个明显的错误,我是 Python 和 BeautifulSoup 的新手。
【问题讨论】:
-
stackoverflow.com/questions/8049520/… 尝试在这里找到更多解决方案。
标签: python web-scraping beautifulsoup