I'm experimenting with ruby and watir for parsing data from the web.

I'm having no problem getting info from standard fields, however I've come across a listbox on one of the pages I'm looking at, and I want to find an easy way of getting the number if items returned in the selectlist element, so that I iterate through them. Any idea how to get the count of items?

I'm experimenting with ruby and watir for parsing data from the web.

I'm having no problem getting info from standard fields, however I've come across a listbox on one of the pages I'm looking at, and I want to find an easy way of getting the number if items returned in the selectlist element, so that I iterate through them. Any idea how to get the count of items?

Hi,

you can get the number of items in a list box by using 'getAllContent.count' method.
eg:ie.select_list(pname,pvalue).getAllContent.count
Please let me know if you need any more information.

Thanks,
Sri.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.