What is the context?  Are you first getting the div via xpath and storing
it in a variable?

If so, you can just do a regex using something like this right?
"<table>[0-9a-zA-Z<> \/]*<\/table>"

If you're trying to do this all in 1 xpath locator, can't you do something
like:

//div[@id="contents"]//table//text()



On Fri, Dec 4, 2015 at 1:17 PM, Super Kevy <[email protected]>
wrote:

> How can I get all the content in a div element then strip out a table
> element leaving only what elements I want?
>
> Assume  a structure like
>
> <div id="contents>
> <p>Static text I want to offline into a file as a static comparison
> later</p>
> <p>If the static content is updated by a change request I will detect the
> changes by a file compare</p>
> <table><tr><td>this table is dynamic is updated with new values all the
> time</td></tr><t/able>
> <p>More static content</p>
> <ul><li>etc, etc</li></ul>
> </div>
>
>
>  The notion is I store the statics in a file then iterating a test that
> can compare the current static elements to an offline file and let me know
> if there are changes.
>  I would like to be able to strip the table from the div wrapper and just
> see the whats left for the comparison.
>
>
> --
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Derek Wrobel
425-243-3355

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to