Hi everyone, I am using urllib to scrape an HTML page, and creating an instance of BeautifulSoup as follows: * *from BeautifulSoup import BeautifulSoup import re, urllib
doc = urllib.urlopen(" http://weather.za.msn.com/local.aspx?wealocations=wc:SFXX0010&q=Cape+Town%2c+Western+Cape ").read() soup = BeautifulSoup(''.join(doc)) #print soup.prettify() weather_row = soup.findAll('tr', class="rs1") print weather_row The call to soup.findAll is failing because "class" is a reserved keyword in Python. Using BeautifulSoup, how can I find a specific table row whose only identifying attribute is its CSS class? Thanks. -- Regards, Sithembewena Lloyd Dube http://www.lloyddube.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor