Jump to content
UBot Underground

Tagging elements with same values and Scraping


Recommended Posts

Hello There,i am the new guy here so i would require some assistance on few things.

I usually work in Imacros,but that language lacks some things,like conditional statements although i am used to it by now so its hard for me to look at Ubot with brand new eyes,and these two work very differently so i wanted to ask few questions to help me start making Bots.

 

Firstly i would like to Thank Seth Turin for creating this amazing program,i am Using Developer version and well i have a lot to learn.

 

1 - I saw almost all tutorials are for Ubot 4 on the tutorial page so my question is,which version do you guys use for your bots and people here usually say they like version 4 i never used it but i saw on the tutorials that is has more useful options.

 

2 -Now i personally have few issues with storing data,see i need a way to store CSV files on some different computer for selling of course for now my biggest issue is how to save the data from variables into CSV file i will give you an example.

 

set(#var1$scrape attribute(<class="mod result idx0 people hover">"innertext"), "Global")
set(#var2$scrape attribute(<class="mod result idx1 people hover">"innertext"), "Global")
set(#var3$scrape attribute(<class="mod result idx2 people hover">"innertext"), "Global")
set(#var4$scrape attribute(<class="mod result idx3 people hover">"innertext"), "Global")
set(#var5$scrape attribute(<class="mod result idx4 people hover">"innertext"), "Global")
set(#var6$scrape attribute(<class="mod result idx5 people hover">"innertext"), "Global")
set(#var7$scrape attribute(<class="mod result idx6 people hover">"innertext"), "Global")
set(#var8$scrape attribute(<class="mod result idx7 people hover">"innertext"), "Global")
set(#var9$scrape attribute(<class="mod result idx8 people hover">"innertext"), "Global")
set(#var10$scrape attribute(<class="mod result idx9 people hover">"innertext"), "Global")
set(#var11$scrape attribute(<class="mod result idx10 people hover">"innertext"), "Global")
add item to list(%Scraped Info"{#var0}{#var1}{#var2}{#var3}{#var4}{#var5}{#var6}{#var7}{#var8}{#var9}{#var10} ""Don\'t Delete""Global")
save to file("{$special folder("Desktop")}\\scraped.csv"%Scraped Info)

 

What i am doing wrong here?

I am sure you will start laughing when you spot my mistake,i cant see it now like i said i started with Ubot just yesterday i Had a LOT more questions but i watched closely many tutorials,and our Wiki page,but guys there work in Ubot 4 so some things are harder to find in Ubot 5.5 that is the version i am using cause there was no other in my dashboard!

 

3- Also i need to know is there a way i can do the following from this picture attached, i need to know how to click on every Tag on the page if just one small string is different like in this example.

(<class="mod result idx3 people hover"

(<class="mod result idx4 people hover"

then after i click on the Tag and go to the page ,is there a way to Extract Current URL in the Browser

 

if you dont feel like writing just send me some tutorial so i know how to do it,I am used to Imacros in there i could do this with my eyes closed,but i just started so if there is someone out there willing to help i would Appreciate it,and hey if you ever need something from me i would help you out too.

 

Or perhaps on Craigslist when you go to listings you need to click different Tags(Ads) is there a way to create a Loop which will loop or increment the Tag position.

idx3 From this

 

idx4 To this one

 

4- Compiling i have some questions with this,Which Compiler works better V4 or version 5.5,I noticed that programs created have long loading periods so anyone have any insight into this,also how do you add your own Icons i tried but i always end up with the Default icon from ubot.

 

5- I have a Question about this>> ui text box<< so i created this object and i wanted to put my password in the variable and then Assign it to this Ui Text Box,Label is not important but i would like my customers to be able to Write their username and Password into these Boxes and be able to login anywhere how can i make this happen??

 

So those were my questions i am sure i will have more of them in Future,but i didn't wanted to bore you too much.

 

If someone could help me with this i would appreciate it greatly,personally i am very good in Imacros and if you need something in there i would gladly help you out!

 

Thank you All 

 

post-18544-0-93096600-1415902964_thumb.jpg

Link to post
Share on other sites

2) You are saving a "%List" to a .csv file,

 

First you should try and workout what format you would like to save your data... If it is a list save to a .txt file, if its is a &table save to a .csv file. 

 

​You can use a "wildcard" (*) and scrape straight to a list.. Like so:

load html("<div class=\"mod result idx0 people hover\">Innertext Value 0</div>
<div class=\"mod result idx1 people hover\">Innertext Value 1</div>
<div class=\"mod result idx2 people hover\">Innertext Value 2</div>
<div class=\"mod result idx3 people hover\">Innertext Value 3</div>
<div class=\"mod result idx4 people hover\">Innertext Value 4</div>
<div class=\"mod result idx5 people hover\">Innertext Value 5</div>")
clear list(%Scrape)
add list to list(%Scrape, $scrape attribute(<class=w"mod result idx* people hover">, "innertext"), "Don\'t Delete", "Global")
comment("Save list to text file.. ")
save to file("{$special folder("Desktop")}\\Scrape_Exampe.txt", %Scrape)

To extract the current url you can just use the "$url" function.

 

3) 

 

Rather than clicking the links on the page, why not use the same example method above but this time scrape the "href" to a list. 

 

Then you can just use the urls for what you need.. or loop through the list navigating to each link in the list.

 

 

Simple loop using same example:

load html("<div class=\"mod result idx0 people hover\">Innertext Value 0</div>
<div class=\"mod result idx1 people hover\">Innertext Value 1</div>
<div class=\"mod result idx2 people hover\">Innertext Value 2</div>
<div class=\"mod result idx3 people hover\">Innertext Value 3</div>
<div class=\"mod result idx4 people hover\">Innertext Value 4</div>
<div class=\"mod result idx5 people hover\">Innertext Value 5</div>")
clear list(%Scrape)
add list to list(%Scrape, $scrape attribute(<class=w"mod result idx* people hover">, "innertext"), "Don\'t Delete", "Global")
comment("Save list to text file.. ")
save to file("{$special folder("Desktop")}\\Scrape_Exampe.txt", %Scrape)
set(#Pos, 0, "Global")
loop($list total(%Scrape)) {
    load html("<span>List Item ({#Pos}) : {$list item(%Scrape, #Pos)}</span>")
    wait(1)
    increment(#Pos)
}

Hope that helps you out a little! :-) 

 

Carl 

 

 

 

 

 

 

 

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