views:

250

answers:

2

I am writing some code that connects to a website, and using C#, and System.IO, reads the html file into my application, and then I continue to parse it.

What I am wanting to do now is, there is a drop down (combobox) on this site, that has 2 static values. I am wanting to have my code pick the 2nd option in the combo box and then parse the resulting html on the post back.

Any Ideas?

Ya the 2 selects are always the same.

Spamming software? Uh... No. It parses a video game website for player stats and I have full permission from the vendor to do so.

Yes I agree about the webservices, and they dont exist. I have already written the HTML parser and it works great. However, I need to pop this drop down for more data

+1  A: 

Say the code looks like this:

What color is your favorite?: <br/>
<form method="post" action="post.php">
        <select name="color">
            <option>AliceBlue</option>
            <option>AntiqueWhite</option>
            <option>Aqua</option>
        </select><br/>
        <input type="submit" value="Submit"/>
</form>

You would want to POST to post.php the argument "color" with the value "Aqua" (or whatever select value you want).

asperous.us
+1  A: 

I'd use HtmlAgilityPack and the HtmlAgilitypPack.AddOns.FormProcessor for that.

Jon Galloway