在:http://arithmetic.zetamac.com/game?key=96823302上,我们需要将问题从<span>
类中的problem
标记中去掉。你知道吗
它是不断更新的,如何使用BeautifulSoup/Python每次检索数据?你知道吗
我知道会是这样的:
from bs4 import BeautifulSoup
soup = BeautifulSoup(requests.get("http://arithmetic.zetamac.com/game?key=96823302").content)
problem = soup.find("span",class_="problem") #Initial finding
a = True
while(a == True):
print problem
problem = soup.find("span",class_="problem")
//然后它将重新循环
但它只打印出来:<span class="problem"></span>
而不是像2 + 2
或2 x 2
那样的内部
目前没有回答
相关问题 更多 >
编程相关推荐