并非所有使用Python在findAll中返回的标签

时间:2013-07-17 00:59:33

标签: python beautifulsoup

我真的很难过这个。我想在以下网址http://www.lse.co.uk/ShareTrades.asp?shareprice=IQE&share=iqe返回Recent Trades表中的所有行,但是findAll只返回了16行。

import urllib2
from BeautifulSoup import BeautifulSoup
soup = BeautifulSoup(urllib2.urlopen('http://www.lse.co.uk/ShareTrades.asp?shareprice=IQE&share=iqe').read())
tradesdate = soup.findAll("div",{"class":"TradesDate"})
tradestime = soup.findAll("div",{"class":"TradesTime"})
i = len(tradesdate)
for counter in range (0,i-1):
    print tradesdate[counter].string + " | " + tradestime[counter].string
    i += 1

0 个答案:

没有答案