Jump to content
UBot Underground

Recommended Posts

I've run into this before and haven't found a solution yet. Quite often when I scrape a variable it returns 3 copies of the same variable, or duplicates it 3 times. Anyone else running into this? Is there a quick cure?

 

Thanks,

Duane

Link to post
Share on other sites

Give me a site to look at.

Same problem here.

 

clear list(%URL_list)
add item to list(%URL_list, $scrape attribute(<tagname="a">, "href"), "Delete", "Global")
save to file("{$special folder("Application")}/urls.txt", %URL_list)

url scraped http://www.lrytas.lt/kiti/rss.htm

 

But only some links 3 times included. But function Delete Duplicates was selected.

 

urls.txt

Link to post
Share on other sites

Here ya go.

 

clear list(%URL_list)

add list to list(%URL_list, $scrape attribute(*">, "href"), "Delete", "Global")

save to file("{$special folder("Application")}/urls.txt", %URL_list)

  • Like 1
Link to post
Share on other sites

For the Delete to work you needed to use the "add list to list ". When you were scraping you were adding One item to the list. So as one item it was unique.

 

Thank you for explanation

Link to post
Share on other sites

Buddy's right...to try and clear it up a little more, if you use add item to list, it may scrape several lines (as viewed in the debugger) that look like a list, but they are not. No matter how many lines are scraped, they are treated as a single item. Sometimes you will run into an issue where it appears more than once in your list because it appears more than once in the document text. One solution is to scrape the multiple items to a list and then set the variable to the first list item (when element offset is not an option).

 

 

John

Link to post
Share on other sites

Give me a site to look at.

 

If you have access to a WHM Panel, that is the latest place I encountered it. Using the command:

 

set(#whmloads, $scrape attribute(<innertext=w"Load Averages: *">, "innertext"), "Global")

 

Returns 3 instances of the same results.

 

It happens quite often so I will let you know the next time it happens in a more public place so you can check it out. I was just wondering if anyone else was experiencing it. I just use regex to get rid of the extra stuff <technical term> but it doesn't seem like it should be happening.

 

Cheers,

Duane

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...