Guzman
New Member
Hi,
I'm trying to write a VBA script for Web Scrapping. I have to select an item form a ListBox (<select> tag in HTML) by its name.
Does anybody know how to do this?
I'm using this libraries:
1. Microsoft Internet Controls
2. HTML Object Library
Here you have some of the HTML code:
I would like to select the item by Name, like: Absolute Return Fund, Asia Pacific Ex-Japan Fund, Blended Research European Equity Fund.
I have Option Explicit feature on, so I would appreciate if you specify the variable type as well.
I'm not an expert programmer, so anything will help.
(I've cross posted, I'll be poting all the answers from the different forums)
I'm trying to write a VBA script for Web Scrapping. I have to select an item form a ListBox (<select> tag in HTML) by its name.
Does anybody know how to do this?
I'm using this libraries:
1. Microsoft Internet Controls
2. HTML Object Library
Here you have some of the HTML code:
Code:
<select onchange="redirect(this.value);" name="select" id="select" style="width: 165px;">
<option value="">Select a fund</option>
<option value="/wps/myportal/mfs/non-us-advisor/products/meridian-funds/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOL9A40C_c09jAzcjYOdDYxcTPyNTUONDS1NjPW99KPSc_KTwEojHfOSjC3S9aOKUtNSi1KL9DLyi0v0I8rLy_Vy04r1kvNz9cOd9aOSKjx88gL1C7KjkiodFRUBZk22dA!!/dl5/d5/L2dJQSEvUUt3QS80SmlFL1o2X09RMlFPN0gyMEczU0MwMkQ0TzM1VTMxRk8y/?clearPortletSession=true&productId=480&shareId=33&viewMode=profile">
<!-- Do Nothing -->
Absolute Return Fund
</option>
<option value="/wps/myportal/mfs/non-us-advisor/products/meridian-funds/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOL9A40C_c09jAzcjYOdDYxcTPyNTUONDS1NjPW99KPSc_KTwEojHfOSjC3S9aOKUtNSi1KL9DLyi0v0I8rLy_Vy04r1kvNz9cOd9aOSKjx88gL1C7KjkiodFRUBZk22dA!!/dl5/d5/L2dJQSEvUUt3QS80SmlFL1o2X09RMlFPN0gyMEczU0MwMkQ0TzM1VTMxRk8y/?clearPortletSession=true&productId=1466&shareId=33&viewMode=profile">
<!-- Do Nothing -->
Asia Pacific Ex-Japan Fund
</option>
<option value="/wps/myportal/mfs/non-us-advisor/products/meridian-funds/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOL9A40C_c09jAzcjYOdDYxcTPyNTUONDS1NjPW99KPSc_KTwEojHfOSjC3S9aOKUtNSi1KL9DLyi0v0I8rLy_Vy04r1kvNz9cOd9aOSKjx88gL1C7KjkiodFRUBZk22dA!!/dl5/d5/L2dJQSEvUUt3QS80SmlFL1o2X09RMlFPN0gyMEczU0MwMkQ0TzM1VTMxRk8y/?clearPortletSession=true&productId=139597&shareId=33&viewMode=profile">
<!-- Do Nothing -->
Blended Research European Equity Fund
</option>
</select>
I would like to select the item by Name, like: Absolute Return Fund, Asia Pacific Ex-Japan Fund, Blended Research European Equity Fund.
I have Option Explicit feature on, so I would appreciate if you specify the variable type as well.
I'm not an expert programmer, so anything will help.
(I've cross posted, I'll be poting all the answers from the different forums)
Last edited: