tangled
alpha
login
or
join now
dekker.one
/
Fourmi
0
fork
atom
A web scraper build to search specific information for a given compound (and its pseudonyms)
0
fork
atom
overview
issues
pulls
pipelines
renamed tables to table in parse()
Rob tB
11 years ago
429ffd74
95565042
+12
-15
1 changed file
expand all
collapse all
unified
split
FourmiCrawler
sources
NIST.py
+12
-15
FourmiCrawler/sources/NIST.py
···
49
49
log.msg('NIST symbol: |%s|, name: |%s|' % (symbol, name),
50
50
level=log.DEBUG)
51
51
52
52
-
for tables in sel.xpath('//table[@class="data"]'):
53
53
-
if tables.xpath('@summary').extract()[0] == 'One dimensional data':
52
52
+
for table in sel.xpath('//table[@class="data"]'):
53
53
+
if table.xpath('@summary').extract()[0] == 'One dimensional data':
54
54
log.msg('NIST table: Aggregrate data', level=log.DEBUG)
55
55
requests.extend(
56
56
-
self.parse_aggregate_data(tables, symbol_table))
57
57
-
elif tables.xpath('tr/th="Initial Phase"').extract()[0] == '1':
56
56
+
self.parse_aggregate_data(table, symbol_table))
57
57
+
elif table.xpath('tr/th="Initial Phase"').extract()[0] == '1':
58
58
log.msg('NIST table; Enthalpy/entropy of phase transition',
59
59
level=log.DEBUG)
60
60
-
requests.extend(self.parse_transition_data(tables))
61
61
-
elif tables.xpath('tr[1]/td'):
60
60
+
requests.extend(self.parse_transition_data(table))
61
61
+
elif table.xpath('tr[1]/td'):
62
62
log.msg('NIST table: Horizontal table', level=log.DEBUG)
63
63
-
elif (tables.xpath('@summary').extract()[0] ==
63
63
+
elif (table.xpath('@summary').extract()[0] ==
64
64
'Antoine Equation Parameters'):
65
65
log.msg('NIST table: Antoine Equation Parameters',
66
66
level=log.DEBUG)
67
67
-
requests.extend(
68
68
-
self.parse_antoine_data(tables))
69
69
-
elif len(tables.xpath('tr[1]/th')) == 5:
67
67
+
requests.extend(self.parse_antoine_data(table))
68
68
+
elif len(table.xpath('tr[1]/th')) == 5:
70
69
log.msg('NIST table: generic 5 columns', level=log.DEBUG)
71
70
# Symbol (unit) Temperature (K) Method Reference Comment
72
72
-
requests.extend(
73
73
-
self.parse_generic_data(tables))
74
74
-
elif len(tables.xpath('tr[1]/th')) == 4:
71
71
+
requests.extend(self.parse_generic_data(table))
72
72
+
elif len(table.xpath('tr[1]/th')) == 4:
75
73
log.msg('NIST table: generic 4 columns', level=log.DEBUG)
76
74
# Symbol (unit) Temperature (K) Reference Comment
77
77
-
requests.extend(
78
78
-
self.parse_generic_data(tables))
75
75
+
requests.extend(self.parse_generic_data(table))
79
76
else:
80
77
log.msg('NIST table: NOT SUPPORTED', level=log.WARNING)
81
78
continue #Assume unsupported