Desktop App: E_TIMEOUT on every check for Facebook group monitor with JS selector

Hi! I have a webpage monitor for a Facebook group (I’m logged in to Facebook in the Desktop App) on Mac. It uses a JavaScript selector that clicks “See more” buttons and returns the post text elements.

The selector works in the preview (it finds 5 elements), but every scheduled check fails with E_TIMEOUT. I’ve tried wait times of 5, 8 and 12 seconds, and a version of the code without setTimeout. Same result.

Is there a setting to run checks in a visible tab/window, or another way to avoid timeouts on Facebook pages? Thanks!

@mdorrestein Could you try creating a new monitor for the same Facebook group, but this time use only a CSS selector to select the elements you want to monitor and do not use the JavaScript selector?

Then let the monitor run for a few scheduled checks and see whether it completes normally without the E_TIMEOUTerror.

If the CSS-only monitor works correctly, then the issue is likely related to the JavaScript selector and it may need to be adjusted.

Also, please open the monitor’s Check Log and click on one of the E_TIMEOUT entries. This should open a detailed error page. Please review the error details there and, if possible, share a screenshot and copy the full error message so we can see exactly why the timeout is occurring.

Thanks! The CSS-only monitor works fine, no timeouts. So the issue is with the JavaScript selector.

Error details from the JS monitor: E_TIMEOUT – Page load timedout after 30 seconds. No snapshot found.

My goal is to click all “See more” (“Visa mer”) buttons on the posts before extracting the text, so that the full post text is captured. This is the JS I used:

(function(){var e=document.querySelectorAll('div,span');for(var i=0;i<e.length;i++){var t=(e[i].innerText||'').replace(/\s/g,'');if((t==='Visamer'||t==='Seemore')&&e[i].children.length===0){(e[i].closest('[role=button]')||e[i]).click();}}return document.querySelectorAll('[data-ad-rendering-role=story_message],[data-ad-preview=message],[data-ad-comet-preview=message]');})();

Is there a recommended way to do this in Distill, for example with a macro that clicks the “See more” buttons before the CSS selector extracts the text? Thanks!

@mdorrestein Since the CSS-only monitor is working correctly, the timeout is indeed coming from the JavaScript selector. We should be able to adjust the JavaScript selector and make it work, but custom JavaScript selector troubleshooting falls under our paid setup service.

The easier option here is to use a Macro to click the “See more” button first, and then let the regular CSS selector extract the expanded post text.

I’ve created a Macro configuration file for you:

Facebook See More macro-8fe3e8a2-c1a1-11f1-b1b3-3f9b6ee8d80a.json (470 Bytes)

Please import this Macro, attach it to your existing monitor, and then test a few scheduled checks to see whether the post is expanded correctly.