question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Faulty Username Parsing...?

See original GitHub issue

First off thanks for this cool script.

Something seems to be wrong with the way you are parsing user names from the html. Not sure if facebook changed their html structure or if this something on my end or what.

I’m using the following command:

fbcap messages.htm -d parsed_msgs/

And get the following output (I removed the FB ID #'s in XXXX@facebook.com):

Discovered chat thread with [XXXXXX@facebook.com, XXXXXXX@facebook.com]...Traceback (most recent call last):
  File "c:\program files (x86)\python\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files (x86)\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python\Scripts\fbcap.exe\__main__.py", line 9, in <module>
  File "c:\program files (x86)\python\lib\site-packages\fbchat_archive_parser\main.py", line 188, in main
    app.run()
  File "c:\program files (x86)\python\lib\site-packages\clip.py", line 652, in run
    self.invoke(self.parse(tokens))
  File "c:\program files (x86)\python\lib\site-packages\clip.py", line 634, in invoke
    self._main.invoke(parsed)
  File "c:\program files (x86)\python\lib\site-packages\clip.py", line 519, in invoke
    self._callback(**{k: v for k, v in iteritems(parsed) if k not in self._subcommands})
  File "c:\program files (x86)\python\lib\site-packages\fbchat_archive_parser\main.py", line 125, in fbcap
    fbch = parser.parse()
  File "c:\program files (x86)\python\lib\site-packages\fbchat_archive_parser\parser.py", line 102, in parse
    self._parse_content()
  File "c:\program files (x86)\python\lib\site-packages\fbchat_archive_parser\parser.py", line 128, in _parse_content
    self._process_element(pos, element)
  File "c:\program files (x86)\python\lib\site-packages\fbchat_archive_parser\parser.py", line 262, in _process_element
    self.current_sender))
Exception: Data missing from message. This is a parsingerror: 2013-06-02 17:22:00-07:00, None

So obviously it’s getting “None” for the username. If I just add the line self.current_user = “Unknown” before the thrown exception the script runs and completes but it obviously just results in every user getting named “Unknown” in every conversation.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ownaginatiouscommented, Jul 4, 2017

I meant the language locale you set your Facebook browsing settings too (most issues stem from other languages), but I was able to reproduce the problem anyway by just downloading my data again in English (US).

Anyway, you’re right in that this issue was caused by a change on Facebook’s end. Unfortunately, it doesn’t seem to be a formatting change… the archives are now literally just missing the name of the user who posted each message 😕

Example:

...
    <div class="message">
        <div class="message_header"><span class="user"></span><span class="meta">Tuesday, February 12, 2013 at 9:15am PST</span></div>
    </div>
...

As you can see, the text is missing in <span class="user"></span>.

I’ll try writing to Facebook to see if they can fix it.

Sorry for the inconvenience 😕

0reactions
eldenvocommented, Aug 14, 2017

No, sadly I tried a different language and re-downloading, for the same problem!

Guess I’ll just keep trying from time to time to see if FB fixes it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Anyconnect Parsing certificate username incorrectly
Solved: Can anyone help me figure out why my "sh vpn-sessiondb anyconnect" doesn't parse the username properly. ... I have this problem too....
Read more >
200 error: missing username when logging in using Parse and ...
I have been able to create users, even validate user's email (through the REST API in Parse) but when I try to login...
Read more >
Parse.User.login don't work as expected · Issue #490 - GitHub
Hi I'm using "parse": "^1.9.2". the problem is present when trying to login with invalid user, it generate an error. when using: Parse.User....
Read more >
QRADAR'S MICROSOFT WINDOWS DSM CAN PARSE ... - IBM
Problem summary. It has been identified that the following MicrosoftWindows DSMs can incorrectly parse the username from gathered/processed events.
Read more >
disable default user authentication in parse server - Server Fault
in my app which use Facebook and Twitter Oauth for login/registrer user. I control in before save trigger if the user provide authData....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found