我正在尝试从维基页面上专门刮掉一些文本this one. 我正在使用BeautifulSoup,或者至少尝试......我对网页浏览没有真正的经验。这是到目前为止我的代码...在美丽的汤中刮去维基页面
import urllib
import urllib.request
from bs4 import BeautifulSoup
soup =BeautifulSoup(urllib.request.urlopen('http://yugioh.wikia.com/wiki/Card_Tips:Blue-Eyes_White_Dragon').read())
for row in soup('span', {'class' : 'mw-headline'})[0].tbody('tr'):
tds = row('td')
print(tds[0].string, tds[1].string, tds[2].string)
我只是试图让每个头(通过,从特殊的手,等召唤检索),并得到每个类别下的每个卡。任何人都可以给我一些建议吗?
OP使用Python 3 .. – 2013-04-04 15:26:56