theninjamanz 29 Posted July 26, 2010 Report Share Posted July 26, 2010 Should I give up now? It's just that I have scraped a page that I want, but now I want to parse that file removing the various instances of formatting I don't want, such as a <P>. I am trying to do this by adding to a list the scraped list and then using a $Replace function on the content node. I then set the Original Text to the scraped list. The thing to find <P> and the thing to replace to a another character. But it won't work. I can scrape the page, but the <P> just doesn't get removed. Do the $replace function work on lists, or only on specified extracts? Thanks Quote Link to post Share on other sites
meter 145 Posted July 26, 2010 Report Share Posted July 26, 2010 If it only works on specified extracts, you could have a LOOP for $list total of the list with scraped items. The LOOP would do NEXT LIST ITEM and set each nextlistitem to a variable. You could then remove the <P> from that variable and then add it to another list, called ProcessedList. Just the way I would do it. Well, the way I would do it is I would write a C# program to do it -meter Quote Link to post Share on other sites
JohnB 255 Posted July 26, 2010 Report Share Posted July 26, 2010 Read Lilly's response from yesterday where she provided an image. It solved the $replace problem for a bunch of us. http://ubotstudio.com/forum/index.php?/topic/4437-replace-problems/page__p__18118&&do=findComment&comment=18118 1 Quote Link to post Share on other sites
smallballz 0 Posted July 26, 2010 Report Share Posted July 26, 2010 I copy it into a text editor like notepad++(supports regular expression) and use the find/replace there. Quote Link to post Share on other sites
Praney Behl 314 Posted July 27, 2010 Report Share Posted July 27, 2010 Hey theninjamanz, I remember have done that in a couple of my bots. I m posting through my phone atm, will have a look for u when I get home to my laptop. Cheers buddy !!Praney Quote Link to post Share on other sites
theninjamanz 29 Posted July 27, 2010 Author Report Share Posted July 27, 2010 Hi there,I managed to get this work, I think it may have been submliminally influenced by Lilly's post. Basically it seems that the replace function will only work if the list is set to a variable. In which case it will pull out the offending item. Otherwise it won't. Just dropped an ezine bot (seems there are many of these...I just did it as a test) into the bots section with the source code if anyone wants to see how I did it. You will see from the source code that I have as much programming prowess as a bull in a china shop. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.