added function to scrape table for Antoine equation parameters
This commit is contained in:
parent
7abb491d3f
commit
151f1988a1
@ -43,6 +43,8 @@ class NIST(Source):
|
||||
'Antoine Equation Parameters'):
|
||||
log.msg('NIST table: Antoine Equation Parameters',
|
||||
level=log.DEBUG)
|
||||
requests.extend(
|
||||
self.parse_antoine_data(tables))
|
||||
elif len(tables.xpath('tr[1]/th')) == 5:
|
||||
log.msg('NIST table: generic 5 columns', level=log.DEBUG)
|
||||
# Symbol (unit) Temperature (K) Method Reference Comment
|
||||
@ -118,6 +120,25 @@ class NIST(Source):
|
||||
results.append(result)
|
||||
return results
|
||||
|
||||
@staticmethod
|
||||
def parse_antoine_data(table):
|
||||
results = []
|
||||
|
||||
name = table.xpath('@summary').extract()[0]
|
||||
|
||||
for tr in table.xpath('tr[td]'):
|
||||
tds = tr.xpath('td/text()').extract()
|
||||
result = Result({
|
||||
'attribute': name,
|
||||
'value': 'A=%s, B=%s, C=%s' % (tds[1], tds[2], tds[3]),
|
||||
'source': 'NIST',
|
||||
'reliability': 'Unknown',
|
||||
'conditions': '%s K' % tds[0]
|
||||
})
|
||||
results.append(result)
|
||||
|
||||
return results
|
||||
|
||||
def new_compound_request(self, compound):
|
||||
return Request(url=self.website[:-1] + self.search % compound,
|
||||
callback=self.parse)
|
||||
|
Reference in New Issue
Block a user