Jump to content
UBot Underground

Scraping list and then checking list with list


Recommended Posts

Hey

 

I'm trying to scrap a page for some keywords and place it in a list, then I want that list to check with another list from a text file. I then want the bot to click all those keywords(links) that are on both of the lists.

I tried diffrent sulutions and guides for many many hours now without any luck.

Would love some help, or so quick advice on how I should solve this.

Link to post
Share on other sites

$common list items

 

 

is what ya need

 

 

pftg4

 

I can't find that command. Is it only for Pro version? Or is it a new command in a recent update?

Link to post
Share on other sites

clear list(%A)
clear list(%B)
clear list(%C)
clear list(%D)
add list to list(%A$list from text("a
b
c
d
e"$new line), "Delete""Global")
add list to list(%B$list from text("b
c
d"$new line), "Delete""Global")
add list to list(%C$subtract lists(%A%B), "Delete""Global")
add list to list(%D$common list items(%A%B), "Delete""Global")

 

%C:   a,e

%D:   b,c and d

Link to post
Share on other sites
  • 2 weeks later...

Thanks for the help but I can't use common list items command, I don't have PRO version or anything like that.

 

Is there a way of doing this without that command?

Link to post
Share on other sites

here you go used it to scrape and compare h3 tags from ubot start page

 

add your file loaction as a parameter

 

and drop a scrape attribute as the other parameter.

define Common list items(#read file location, #Scrape Attribute) {
    clear list(%common list items)
    clear list(%Scraped keywords)
    add list to list(%Scraped keywords, $list from text(#Scrape Attribute, $new line), "Delete", "Global")
    set(#list position, 0, "Global")
    loop($list total(%Scraped keywords)) {
        if($contains(#read file location, $list item(%Scraped keywords, #list position))) {
            then {
                add item to list(%common list items, $list item(%Scraped keywords, #list position), "Delete", "Global")
            }
            else {
            }
        }
        increment(#list position)
    }
    clear list(%Scraped keywords)
    set(#Scrape Attribute, "", "Global")
    set(#read file location, "", "Global")
    set(#list position, "", "Global")
}
Common list items($read file("C:\\Users\\Dave\\Desktop\\New Text Document.txt"), $scrape attribute(<tagname="h3">, "innertext"))

Link to post
Share on other sites

 

here you go used it to scrape and compare h3 tags from ubot start page

 

add your file loaction as a parameter

 

and drop a scrape attribute as the other parameter.

define Common list items(#read file location, #Scrape Attribute) {
    clear list(%common list items)
    clear list(%Scraped keywords)
    add list to list(%Scraped keywords, $list from text(#Scrape Attribute, $new line), "Delete", "Global")
    set(#list position, 0, "Global")
    loop($list total(%Scraped keywords)) {
        if($contains(#read file location, $list item(%Scraped keywords, #list position))) {
            then {
                add item to list(%common list items, $list item(%Scraped keywords, #list position), "Delete", "Global")
            }
            else {
            }
        }
        increment(#list position)
    }
    clear list(%Scraped keywords)
    set(#Scrape Attribute, "", "Global")
    set(#read file location, "", "Global")
    set(#list position, "", "Global")
}
Common list items($read file("C:\\Users\\Dave\\Desktop\\New Text Document.txt"), $scrape attribute(<tagname="h3">, "innertext"))


Thanks for the help but that code is also using the command common list items, which isn't avaiable in my version of Ubot (standard edition)

 

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