Jump to content
UBot Underground

Help with UI dropdown


Recommended Posts

So after viewing a pretty good video tutorial on how to scrape data from a website I created my own bot for fun and it currently runs pretty good. 

 

Now I'm trying to change some of the UI elements (in this case the drop) to look better than what i currently have. The drop down is basically a selection of urls to choose from but I would like it to show up as the actually category (Art, Food, etc) instead of the full url path.

 

http://s11.postimg.org/oasn074r7/uibox.png

 

ui drop down("Category""http://fancy.com/shop/art,http://fancy.com/shop/food"#categories)
ui stat monitor("Titles Scraped:"$list total(%titles))
ui stat monitor("URLs Scraped:"$list total(%urlslist))
ui stat monitor("Images Scraped:"$list total(%fullsizeimage))
ui stat monitor("Thumbnails Scraped:"$list total(%imageurls))
define Scrape Data {
    clear cookies
    navigate(#categories"Wait")
    clear table(&fancyitems)
    clear list(%titles)
    clear list(%urlslist)
    clear list(%fullsizeimage)
    clear list(%imageurls)
    clear list(%description)
    add list to list(%titles$page scrape("<figcaption>""</figcaption>"), "Don\'t Delete""Global")
    add list to list(%urlslist$page scrape("<a href=\"/things""\""), "Don\'t Delete""Global")
    remove from list(%urlslist, 0)
    add list to list(%imageurls$page scrape("image:url(\'""\')\">"), "Don\'t Delete""Global")
    loop($list total(%imageurls)) {
        navigate("http://fancy.com/things{$next list item(%urlslist)}""Wait")
        add item to list(%fullsizeimage$scrape attribute(, "src"), "Don\'t Delete""Global")
        add item to list(%description$page scrape("<meta property=\"og:description\" content=\"""\">"), "Delete""Global")
    }
}
Scrape Data()
add list to table as column(&fancyitems, 0, 0, %titles)
add list to table as column(&fancyitems, 0, 1, %urlslist)
add list to table as column(&fancyitems, 0, 2, %description)
add list to table as column(&fancyitems, 0, 3, %fullsizeimage)
save to file("{$special folder("Desktop")}/fancyitems.csv"&fancyitems)
navigate("http://www.fancy.com/""Wait")
alert("I\'m Done. Wanna Play.")

Edited by flexfanatic
Link to post
Share on other sites

You can't do that with "ui drop down", you would need to use custom HTML UI and display it via "ui html panel".

 

Here is an example:

ui html panel("<select variable=\"#var\" fillwith=\"value\">
			<option value=\"\">Select One</option>
			<option value=\"url1\">Cat1 </option>
			<option value=\"url2\">Cat2</option>
			<option value=\"url3\">Cat3</option>
		</select>
", 200)

Link to post
Share on other sites

 

You can't do that with "ui drop down", you would need to use custom HTML UI and display it via "ui html panel".

 

Here is an example:

ui html panel("<select variable=\"#var\" fillwith=\"value\" />
			<option value=\"\">Select One</option>
			<option value=\"url1\">Cat1 </option>
			<option value=\"url2\">Cat2</option>
			<option value=\"url3\">Cat3</option>
		</select>
", 200)

 

 

Thanks that worked (although it broke my stat monitors but I can likely fix that without a lot of work).

 

<select variable="#categories" fillwith="value" />
<option value="">Select Category</option>
<option value="http://fancy.com/shop/art/">Art </option>
<option value="http://fancy.com/shop/food/">Food</option>
<option value="url3">Cat3</option>
</select>
Link to post
Share on other sites

No problem.

 

I actually noticed that I had a typo in my code, so I changed previous post...

 

You will have to re-code the whole UI with HTML, since if you use "ui hml panel" that will prevent you to use other "ui" commands.

 

In case you don't know, this is how ui stat looks like in HTML:

<div variable="#STATUS" fillwith="innerhtml">Status</div>
Link to post
Share on other sites

Here is another option for you...

 

 

ui drop down("Choose Category", "None,Food, Art", #cats)

if($comparison(#cats, "=", "Food")) {

then {

navigate("http://fancy.com/shop/food", "Wait")

}

}

if($comparison(#cats, "=", "Art")) {

then {

navigate("http://fancy.com/shop/art", "Wait")

}

}

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