ignore bad titles
[disclosr.git] / documents / scrapers / 227cb6eb7d2c9f8a6e846df7447d6caa.py
blob:a/documents/scrapers/227cb6eb7d2c9f8a6e846df7447d6caa.py -> blob:b/documents/scrapers/227cb6eb7d2c9f8a6e846df7447d6caa.py
--- a/documents/scrapers/227cb6eb7d2c9f8a6e846df7447d6caa.py
+++ b/documents/scrapers/227cb6eb7d2c9f8a6e846df7447d6caa.py
@@ -11,35 +11,38 @@
                 links = []
                 description = ""
 		for atag in entry.find_all('a'):
-			if atag.has_key('href'):
+			if atag.has_attr('href'):
 				link = scrape.fullurl(self.getURL(),atag['href'])			
                                 (url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False)
                                 if htcontent != None:
                                         if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
                                         # http://www.crummy.com/software/BeautifulSoup/documentation.html
                                                 soup = BeautifulSoup(htcontent)
-                                                for row in soup.find(class_ = "ms-rteTable-GreyAlternating").find_all('tr'):
+						rowtitle = soup.find(class_ = "wc-title").find("h1").string
+                                                if rowtitle != None:
+                                                   description = rowtitle + ": "
+                                                for row in soup.find(class_ ="wc-content").find_all('td'):
                                                         if row != None:
-								rowtitle = row.find('th').string
-                                                                if rowtitle != None:
-                                                                    description = description + "\n" + rowtitle + ": "
-                                                                for text in row.find('td').stripped_strings:
-                                                                    description = description + text
+                                                                for text in row.stripped_strings:
+                                                                    description = description + text + "\n"
                                                      		for atag in row.find_all("a"):
-                                                                	if atag.has_key('href'):
+                                                                	if atag.has_attr('href'):
                                                                         	links.append(scrape.fullurl(link,atag['href']))
 
 		if links != []:
                  	doc.update({'links': links})
                 if description != "":
                         doc.update({ 'description': description})
-
+	def getRows(self, table):
+		return table.find_all(class_ = "dl-row");
+	def findColumns(self, table):
+		return table.find_all('div');
 	def getColumnCount(self):
 		return 2
 	def getTable(self,soup):
-		return soup.find(class_ = "ms-rteTable-GreyAlternating")
+		return soup.find(class_ = "foi-dl-list")
 	def getColumns(self,columns):
-		(date, title) = columns
+		(title,date) = columns
 		return (title, date, title, title, None)
 
 if __name__ == '__main__':