[Pro] Strip everything except content of Body tag

Hi!

I’ve been playing with the code given in the Actions Reference PDF to try to strip a page down to just the Body contents.

I’ve got this far:

var doctypeTag = fwDocument.fwTags.fwFind(’!DOCTYPE’);

doctypeTag.fwDelete();

body = fwDocument.fwTags.fwFind(“body”);

bodyContent = body.fwFindAllContent();

html = fwDocument.fwTags.fwFind(“html”);

html.fwDelete();

fwDocument.fwTags.fwMove(bodyContent);

But it only outputs the Table tag, not any of its TR contents.

Any ideas?

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

I would take a look at the PHP Make Insert Page Action for some reference code. PHP Make Insert Page - ActionsForge Check the source to ensure that there are some updates in it from me (last one was in 2010). If you don’t see that, please let me know.

Walter

On Mar 23, 2020, at 7:50 AM, Ian Webb via actionsdev email@hidden wrote:

Hi!

I’ve been playing with the code given in the Actions Reference PDF to try to strip a page down to just the Body contents.

I’ve got this far:

var doctypeTag = fwDocument.fwTags.fwFind(’!DOCTYPE’);

doctypeTag.fwDelete();

body = fwDocument.fwTags.fwFind(“body”);

bodyContent = body.fwFindAllContent();

html = fwDocument.fwTags.fwFind(“html”);

html.fwDelete();

fwDocument.fwTags.fwMove(bodyContent);

But it only outputs the Table tag, not any of its TR contents.

Any ideas?

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Hi Walter!

Thanks, that got it! I think the bit I was missing out was the ‘enclosesHTML’ part but, to be honest, I still don’t understand how it works!

I’ve posted it to ActionsForge: Strip Head & Body tags - ActionsForge

Cheers, Ian.


actionsdev mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options