Community » Posted by samsam
Hi Samsam, thank you for your post!
It looks like the browser is prematurely cutting off the HAR file contents on export (resulting in a bad HAR file), as the error message suggests it can't parse the HAR file because the payload from the browser is incomplete. As you suggested, this can sometimes happen with larger HAR files that your browser can have trouble with.
The easiest fix is to simply export multiple, smaller HAR files to prevent the browser from doing this. So I would suggest trying the following:
1) Open up developer tools (to begin recording network traffic) and navigate to the Instagram post you want to scrape the comments of - but don't click on the post just yet or load any of the comments.
2) Hit the "Clear" icon in the Network tab in developer tools. This will "clear" up anything the browser has previously recorded (that may be causing the issue) and should help prevent it from crashing since it will have less to record.
3) Scroll through half of the comments, say 1,000, and then export a HAR file. Name it something like "Instagram Comments Part 1" and save it to your computer.
4) Hit the "Clear" icon in the Network tab again (to reset the recording) and repeat the process above, scrolling through the next 1,000 Instagram comments, then export, etc...
You can then parse the individual, smaller HAR files and later on combine the CSV output together.
If you still want to try getting them all into one HAR file, then hitting "Clear" just before doing the scrolling may be enough to prevent the browser from crashing on HAR file export. We've also sometimes seen Firefox work a little better when exporting large HAR files, so it may be worth giving that a try as well. In the "Filter" bar in the Network tab on Firefox, it can also help if you type in the URL of the network requests with the payload in it to only export those (with the Instagram comments in them).
Please let us know if this helps - or if you need more clarification please don't hesitate to reach out using the customer support widget (bottom right of the screen) and we can reply with more information, screenshots, etc...
Thanks!
By steve Moderator