Hi! 

I'm trying to use BeautifulSoup for get data from a table (on right) from:
http://en.wikipedia.org/wiki/United_states 

i.e. i would get data from 'Calling code' that it would be '+1' 

 ---------------------- 

import urllib2
from BeautifulSoup import BeautifulSoup 

url="http://en.wikipedia.org/wiki/United_states";
html = urllib2.urlopen(url).read()
soup = BeautifulSoup()
soup.feed(html) 

mainTable = soup.first('table')
rows = mainTable('tr') 


any help here? 

Thanks in advance 
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to