Code: Alles auswählen
import urllib2
from BeautifulSoup import BeautifulSoup
wurls=['http://www.coh-stats.com/factions/british/weapons/leeenfield.html']
while i < len(wurls):
page = urllib2.urlopen(wurls[i])
soup = BeautifulSoup(page)
soup.prettify()
a=soup.findAll('td')
weaponb = [[a[11].contents[0]],[a[18].contents[0]],[a[71].contents[0]],[a[85].contents[0]],[a[74].contents[0]]]
while i < len(weaponb):
weaponb[i] = map(str,weaponb[i])
i = i +1
Mache ich nun aber[['3-2.5'], ['0.3-0.1'], ['2-1.5'], ['-'], ['-']]
Code: Alles auswählen
print weaponb[4]=='-'