Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fbchat_archive_parser.parser.FacebookDataError #53

Closed
ckshitij opened this issue Oct 12, 2017 · 5 comments
Closed

fbchat_archive_parser.parser.FacebookDataError #53

ckshitij opened this issue Oct 12, 2017 · 5 comments

Comments

@ckshitij
Copy link

Getting error at a time of parsing the message.htm file
Related files are Attached
parse_file.zip

fbcap ./messages.htm > fbMessages.txt

Traceback (most recent call last):

File "/Users/coddict/anaconda/bin/fbcap", line 11, in <module>
  load_entry_point('fbchat-archive-parser==1.0.post1', 'console_scripts', 'fbcap')()
File "/Users/coddict/anaconda/lib/python3.6/site-packages/click/core.py", line 722, in __call__
  return self.main(*args, **kwargs)
File "/Users/coddict/anaconda/lib/python3.6/site-packages/click/core.py", line 697, in main
  rv = self.invoke(ctx)
File "/Users/coddict/anaconda/lib/python3.6/site-packages/click/core.py", line 895, in invoke
  return ctx.invoke(self.callback, **ctx.params)
File "/Users/coddict/anaconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
  return callback(*args, **kwargs)
File "/Users/coddict/anaconda/lib/python3.6/site-packages/fbchat_archive_parser/main.py", line 118, in fbcap
  fbch = parser.parse()
File "/Users/coddict/anaconda/lib/python3.6/site-packages/fbchat_archive_parser/parser.py", line 92, in parse
  self._parse_content()
File "/Users/coddict/anaconda/lib/python3.6/site-packages/fbchat_archive_parser/parser.py", line 117, in _parse_content
  self._process_element(pos, element)
File "/Users/coddict/anaconda/lib/python3.6/site-packages/fbchat_archive_parser/parser.py", line 250, in _process_element

"An unrecoverable parsing error has occurred (missing timestamp data)"
fbchat_archive_parser.parser.FacebookDataError: An unrecoverable parsing error has occurred (missing timestamp data)

@ownaginatious
Copy link
Owner

ownaginatious commented Oct 12, 2017

Hi there! Unfortunately, the data you sent me in the zip file isn't very helpful; it's just a subset of the source code of this project.

As to your issue, it appears from the exception that there is at least one message in your messages.htm file that's missing timestamp data. Unfortunately, I cannot really diagnose what's wrong with it without looking in the file myself. Obviously that's private and you shouldn't post it ;)

To help diagnose the issue, you could add the following print statement after this line:

        ...
        elif tag == "p" and pos == "end":
            print (self.current_timestamp, self.current_sender, e.text.strip() if e.text else "")
            ...

That will at least tell you how many messages the parser gets through before crashing.

@arnaudsm
Copy link

Same problem here ! It seems that Facebook changed the archive structure recently.
Now the messages.htm file is only a few KB, and all the threads are in separate .html files in a /messages/ folder ! The whole parser is broken now..

@ownaginatious
Copy link
Owner

Thanks for letting me know. I'll take a look soon.

@ownaginatious
Copy link
Owner

@arnaudsm @ckshitij okay, should be fixed now. Please try the latest version: 1.1

@ckshitij
Copy link
Author

@ownaginatious Thank you so much, it's working now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants