Jump to content
UBot Underground

Recommended Posts

I want to automate adding products to an ecommerce site, I have a list of products in a csv file, the fields includes code, product name, price, size and color. Now the ecommerce site has a list of colors and use checkbox element for selecting color. My biggest challenge is how to get the value from csv and let ubot check the checkbox of the appropriate color. Does anyone know how to do it? I'm new to ubot. Thanks ahead!

Link to post
Share on other sites

Here is an example of how you can do this, it may not be the exact same on your webpage but hopefully this gives you an idea on how to achieve this:

navigate("https://ubotstudio.com/site/playground-difficult-form/","Wait")
wait(2)
clear table(&colors)
set table cell(&colors,0,0,"Yellow")
set table cell(&colors,1,0,"Red")
set table cell(&colors,2,0,"Pink")
set(#row,0,"Global")
loop($table total rows(&colors)) {
    set(#color,$table cell(&colors,#row,0),"Global")
    if($exists(<(type="checkbox" AND value=#color)>)) {
        then {
            change checkbox(<(type="checkbox" AND value=#color)>,"Checked")
        }
        else {
        }
    }
    increment(#row)
}
  • Like 1
Link to post
Share on other sites

 

Here is an example of how you can do this, it may not be the exact same on your webpage but hopefully this gives you an idea on how to achieve this:

navigate("https://ubotstudio.com/site/playground-difficult-form/","Wait")
wait(2)
clear table(&colors)
set table cell(&colors,0,0,"Yellow")
set table cell(&colors,1,0,"Red")
set table cell(&colors,2,0,"Pink")
set(#row,0,"Global")
loop($table total rows(&colors)) {
    set(#color,$table cell(&colors,#row,0),"Global")
    if($exists(<(type="checkbox" AND value=#color)>)) {
        then {
            change checkbox(<(type="checkbox" AND value=#color)>,"Checked")
        }
        else {
        }
    }
    increment(#row)
}

Thanks for the idea HelloInsomnia! its working now!

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