Jump to content
UBot Underground

Find and Replace against things in a list


Recommended Posts

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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 :)

Link to post
Share on other sites

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.

 

;)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...