runforrestrun 0 Posted July 31, 2012 Report Share Posted July 31, 2012 Hello everyone, hopefully someone can help me since I am having difficulties with the "condition" part of the loop while command. I managed to scrape the drop down menu options into a list. Then I use the loop while command to loop through and choose the option from the drop down menu using the change drop down command. I have placed a next list item function inside the change drop down command. However, I don't know how to make the loop stop once the correct option is selected. I would like to somehow compare the current selected option on the drop down menu with a variable. Also, is it possible to select an option from a drop down menu using a wildcard? This is the drop down menu I'm working with: http://bestphpdirectory.com/submit.php Thanks Quote Link to post Share on other sites
JohnB 255 Posted August 1, 2012 Report Share Posted August 1, 2012 I'm not sure exactly what you mean, but it sounds relatively simple. What are you doing with the scraped options? John Quote Link to post Share on other sites
runforrestrun 0 Posted August 1, 2012 Author Report Share Posted August 1, 2012 I'm not sure exactly what you mean, but it sounds relatively simple. What are you doing with the scraped options? John Here is the code I'm using: ui drop down("Category:", "Health,Sports,Business,Technology", #category)if($contains($scrape attribute(<name="CATEGORY_ID">, "innerhtml"), #category)) { then { add item to list(%scrape categories, $scrape attribute(<tagname="option">, "innertext"), "Delete", "Global") save to file("{$special folder("Desktop")}\\categories.txt", %scrape categories) add list to list(%scrape categories2, $list from file("{$special folder("Desktop")}\\categories.txt"), "Delete", "Global") loop while($comparison($contains($next list item(%scrape categories2), #category), "=", $true)) { change dropdown(<name="CATEGORY_ID">, $next list item(%scrape categories2)) } } else { }} 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.