cancel
Showing results for 
Search instead for 
Did you mean: 
consoul
Level 9

Page body inspection example rule?

Anyone have an example rule to block a specific pattern in the body of a page? I understand the possible load ramifications of doing this and we are using a regex filter to cut down on hits. Currently it would be about 5k hits per week to the rule based on our url regex filtering.

I just want to block a specific string in the first 300 bytes of the page. I have tried Body.ToString, Body.PositionOfPattern, Body.Text... Nothing seems to be working. If someone has a working copy of a rule that can do this I would really appreciate being let in on the secret.

I dont want to give the actual string here but it would be something like:  <table width="300" border="1" cellpadding="3" bordercolor="#000FFF"><tr><td><div align="center">Doing this here...</div></td></tr></table></a>

Message was edited by: consoul on 2/28/14 12:43:58 PM CST
0 Kudos
3 Replies
eelsasser
Level 15

Re: Page body inspection example rule?

Will the "Doing this here..." always be within a <div> tag?

We can use the HTML opener and target the content in the <div> only, as opposed to matching on the entire Body.Text.

Also, do you want to block the entire page if there is a match or simply remove the content inside the <div>?

I do something similar with the HTML opener when i want to remove specific content from a page, but leave the rest of the page intact.

I've attached a set of rules i use for removing certain named <div> elements from a facebook page. you might be able to do something similar.

Message was edited by: eelsasser -- typos on 3/1/14 12:07:16 PM EST
0 Kudos
consoul
Level 9

Re: Page body inspection example rule?

Thank you for the quick reply. Unfortunately I am on 7.3.2.3 and it's complaining that the rule you supplied is from 7.4.1.1.0

Do you by chance have a screenshot of your awesome sauce rule?

0 Kudos
consoul
Level 9

Re: Page body inspection example rule?

Never mind, I edited the xml and replaced your version with mine (7.3.2.3.0-16052) and it worked. 

0 Kudos