ILoveUBot 10 Posted May 20, 2012 Report Share Posted May 20, 2012 I would like to scrape the three strings between value="..." as in the following example: <ul class="radio_list"><li><input name="answer_70603" type="radio" value="45 minutes" id="answer_70603_45_minutes" /> <label for="answer_70603_45_minutes">45 minutes</label></li> <li><input name="answer_70603" type="radio" value="15 minutes" id="answer_70603_15_minutes" /> <label for="answer_70603_15_minutes">15 minutes</label></li> <li><input name="answer_70603" type="radio" value="60 minutes" id="answer_70603_60_minutes" /> <label for="answer_70603_60_minutes">60 minutes</label></li></ul> I then want to take each value and put it into a list: 45 minutes15 minutes60 minutes I realise I'm probably over thinking it, but I'm going round in circles and can't work out what I should be doing. I did attempt to use regex with this: \svalue="(.*?)" but then couldn't work out where I should place it in UBot. Can anyone help advise me? Quote Link to post Share on other sites
JohnB 255 Posted May 20, 2012 Report Share Posted May 20, 2012 ry this: clear list(%scrape)load html("<ul class=\"radio_list\"><li><input name=\"answer_70603\" type=\"radio\" value=\"45 minutes\" id=\"answer_70603_45_minutes\" /> <label for=\"answer_70603_45_minutes\">45 minutes</label></li><li><input name=\"answer_70603\" type=\"radio\" value=\"15 minutes\" id=\"answer_70603_15_minutes\" /> <label for=\"answer_70603_15_minutes\">15 minutes</label></li><li><input name=\"answer_70603\" type=\"radio\" value=\"60 minutes\" id=\"answer_70603_60_minutes\" /> <label for=\"answer_70603_60_minutes\">60 minutes</label></li></ul>")add list to list(%scrape, $scrape attribute(<for=w"answer_*">, "innertext"), "Delete", "Global") John Quote Link to post Share on other sites
ILoveUBot 10 Posted May 20, 2012 Author Report Share Posted May 20, 2012 Wow, thank you John, that worked perfectly Quote Link to post Share on other sites
JohnB 255 Posted May 20, 2012 Report Share Posted May 20, 2012 No problem. Glad I could help. John 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.