mj1231 0 Posted June 9, 2017 Report Share Posted June 9, 2017 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! Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted June 9, 2017 Report Share Posted June 9, 2017 This should help http://network.ubotstudio.com/forum/index.php/topic/20923-how-to-copy-and-delete-data-from-csv-file/ 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted June 9, 2017 Report Share Posted June 9, 2017 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) } 1 Quote Link to post Share on other sites
mj1231 0 Posted June 13, 2017 Author Report Share Posted June 13, 2017 Thanks for the idea HelloInsomnia! its working now! Quote Link to post Share on other sites
mj1231 0 Posted June 13, 2017 Author Report Share Posted June 13, 2017 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! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.