I have a dynamic webpage that includes an iFrame where external html code is included. Now I need to dynamically remove an element from this iFrame’s body.
Firebug gives me the following XPath Entry for the Element.
/html/body/div[2]/div[2]/ol/table/tbody/tr/td/a/img
My question now is how can I transform this into a DOM Element Structure to create Javascript which will remove the element?
Or is there any other way to remove this image?
[EDIT]
The source of the iFrame is created by another webserver. We generate it there because of load sharing.
I may be misguided here, but I believe you will start to run into strange problems ( I had a similar experience) when trying to manipulate Iframes with Javascript. It boils down to the same-origin policy. Basically you can not write a script that manipulates content from a different source. This makes sense most of the time for obvious security reasons. This may not be the cause of your problems but keep it in the back of your mind.
see http://en.wikipedia.org/wiki/Same_origin_policy