Skip to content

Commit 251c16e

Browse files
committed
Fix bug in parsing text containing html tag
1 parent 3799997 commit 251c16e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

astroquery/oac/core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import json
1414
import csv
15+
import re
1516

1617
import astropy.units as u
1718
from astropy.table import Column, Table
@@ -435,7 +436,12 @@ def _args_to_payload(self, event, quantity,
435436

436437
def _format_output(self, raw_output):
437438
if self.FORMAT == 'csv':
438-
split_output = raw_output.splitlines()
439+
440+
fixed_raw_output = re.sub('<[^<]+?>', '', raw_output)
441+
split_output = fixed_raw_output.splitlines()
442+
443+
# Remove any HTML tags
444+
439445
columns = list(csv.reader([split_output[0]], delimiter=',',
440446
quotechar='"'))[0]
441447
rows = split_output[1:]

0 commit comments

Comments
 (0)