Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2010 [RESOLVED] Pulling an Element From an HTML Array Using WebBrowser

$
0
0
Hello,

I am working on a program that generates a batch file partially from excel data and partially from an online database with a web interface. I'm using WebBrowser rather than a WebClient because to access the database the user has to go through a company global login page since the database is on the company intranet.

For most of the fields it has been fairly straightforward pulling data from the page using GetAttribute. However I've found that using this method to pull the County doesn't return the county as the user sees it. For example, the page would display a county called "Accomack" but when I use the method GetElementById("county").GetAttribute("value") it pulls an integer instead of the county name, "2814" in this case.

I discovered that embedded in the HTML is an array for every county in the US, each county being assigned an identifier code. The HTML code is as follows:

HTML Code:

var arrCounty = new Array (
                        new Array( '2310','Abbeville','SC'),
                        new Array( '1111','Acadia','LA'),
                        new Array( '2814','Accomack','VA'),


So what method can I use to return the county name, and possibly state too, rather than pulling the useless identifier code?

Thanks,
Michael



Edit: I should clarify that the array created is actually a javascript array which I believe is then pulled by the HTML field.

Viewing all articles
Browse latest Browse all 27189

Trending Articles