A web scraper build to search specific information for a given compound (and its pseudonyms)

added summary variable in parse()

Rob tB c0af2464 429ffd74

+3 -3
+3 -3
FourmiCrawler/sources/NIST.py
··· 50 50 level=log.DEBUG) 51 51 52 52 for table in sel.xpath('//table[@class="data"]'): 53 - if table.xpath('@summary').extract()[0] == 'One dimensional data': 53 + summary = table.xpath('@summary').extract()[0] 54 + if summary == 'One dimensional data': 54 55 log.msg('NIST table: Aggregrate data', level=log.DEBUG) 55 56 requests.extend( 56 57 self.parse_aggregate_data(table, symbol_table)) ··· 60 61 requests.extend(self.parse_transition_data(table)) 61 62 elif table.xpath('tr[1]/td'): 62 63 log.msg('NIST table: Horizontal table', level=log.DEBUG) 63 - elif (table.xpath('@summary').extract()[0] == 64 - 'Antoine Equation Parameters'): 64 + elif summary == 'Antoine Equation Parameters'): 65 65 log.msg('NIST table: Antoine Equation Parameters', 66 66 level=log.DEBUG) 67 67 requests.extend(self.parse_antoine_data(table))