Search the Community
Showing results for tags 'cut'.
-
Hey everyone, I am working on a script for which I have a webpage saved. At the start of the program, the program loads the source code into a variable, removes all script and noscript, and then it must cut out a div called product (<div id="product">). The problem is that each time I try to write this function, I have problems detecting how many child divs it has nested in it. I have tried also writing a function that determines the amount of characters in the div, for trimming to the right of the div, but this has not worked. I dont wish to use an embedded browser for my program, I just want to work with the strings. Could anybody give me any pointers? Thanks. EDIT I have found the following forum post: The problem is though, that (as far as I am aware) it requires you to use the embedded browser or just use internet explorer, which will not help me as I just want to read the source code. I am aware that I can load the source into the browser and then hide the browser, but I would rather just "cut" the div out of the source. Thanks. SOLUTION Thanks to thanlankon. Please note that this also returns the div tags (opening and closing) for the specified div. It also removes the " character from either side of the ID name.