Skip to content

Commit

Permalink
use demjson.decode to parse data-ft
Browse files Browse the repository at this point in the history
Fixes JSONDecodeError('Invalid \escape: line 1 column 306 (char 305)')
  • Loading branch information
neon-ninja committed Jul 26, 2021
1 parent 0d18488 commit b565da2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion facebook_scraper/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def data_ft(self) -> dict:
self._data_ft = {}
try:
data_ft_json = self.element.attrs['data-ft']
self._data_ft = json.loads(data_ft_json)
self._data_ft = demjson.decode(data_ft_json)
except JSONDecodeError as ex:
logger.error("Error parsing data-ft JSON: %r", ex)
except KeyError:
Expand Down

0 comments on commit b565da2

Please sign in to comment.