Jump to content
UBot Underground

Get Proper Category In Website Based On User Selection


Recommended Posts

Hi,

 

I'm making a simple Wordpress poster to learn Ubot.

 

Everything works well so far, except, selecting the chosen Category by user. (Ubot gets the list of the cats and adds them to a dropdown).

 

The thing is, I have no idea how to find the chosen checkbox by user.

Using a simple "Change Attribute" command is NOT what I mean.

 

For example:

 

  1. Wordpress Categories are: "Dogs", "Cats", "Ducks".
  2. They are added to a dropdown automatically (using list command and functions) when user logs in to the site.
  3. User choose "Dogs", fill other fields and clicks on "Post to Website" button.
  4. I get what user have chosen (name and unique category number), now I need to find the user selection in Wordpress categories list. this is my problem.
  5. And at last, change the checkbox to Checked using "Change Attribute" - easy part !

Should I use Loop? If? ...?

if yes, then how?

 

I appreciate if you help me understanding this.

Link to post
Share on other sites

run this on Ubot 4, 5 is a bit flaky running load HTML

load html("<!DOCTYPE html>
<html>
<body>

<select>

  <option value=\"volvo\">Volvo</option>
  <option value=\"saab\">Saab</option>
  <option value=\"opel\">Opel</option>
  <option value=\"audi\">Audi</option>
</select>
  
</body>
</html>

")
alert($scrape attribute(<tagname="select">,"value"))

I can only guess that you are trying to scrape from a dropdown,in a dropdown the current selection is the value attribute of the Select tag

Link to post
Share on other sites

It should be something like this (no license serv and can not run ubot so its not the copy/paste code}:

 

If

comparison

#category=dog

then

click {innertext "Dog"}

else if

comparison

category=bird

then

click {innertext "Bird}

...

 

At least i would do it this way. probably better coders here ..

Link to post
Share on other sites

Thank you Vladislav and TJ,

 

It seems I'm unable to explain what the problem is, or it's very complicated.

 

I'm going to screencast it, so you will figure out what's the problem.

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