1

我真的被这个难住了。我想在以下 URL http://www.lse.co.uk/ShareTrades.asp?shareprice=IQE&share=iqe返回最近交易表中的所有行,但是从findAll.

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
4

0 回答 0