![]() |
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Kyahahaha! The world is mine! | I am working on a bot and on the site there are two forum fields by the same name in two different cases. I want to only fill one field but for some reason it will always fill the other field. How can I change that. Code I am trying to use: Code: this.webBrowser1.Document.GetElementById("username").SetAttribute("value", this.txtUser.Text)
|
| | |
| Sponsored Links | |
| | #2 (permalink) | |
| Noob Helper | What is the webpage? If the ids are different, you can use the ids, otherwise you will have to loop through the elements until you get to the right one.
__________________ For all of my bots, click here Quote:
| |
| | |
| | #4 (permalink) | |
| Noob Helper | What is different about them? Is there some attribute that is different between the two? An example of looping through: Code: string password = "password";
HtmlElementCollection collection = webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement el in collection)
{
if (el.GetAttribute("value") == "Username")
{
el.SetAttribute("value", this.txtUser.Text);
}
}
__________________ For all of my bots, click here Quote:
| |
| | |
| | #6 (permalink) | |
| Noob Helper | Give me the html of the two elements.
__________________ For all of my bots, click here Quote:
| |
| | |
| | #7 (permalink) |
| Senior Member | GetElementById should only return the first element that it finds, so it should work fine.
__________________ ![]() http://bux.to/?r=anigma || http://apple.v-bux.com/index.php?id=8356 << ONLY 4 REF FOR AN IPHONE! |
| | |
| | #8 (permalink) |
| Junior Member Join Date: Feb 2008
Posts: 12
Reputation: 0 ![]() cBay Rating: | You should show us the HTML so we can exam it better, but you could try this: Code: webBrowser1.Document.Forms[2].GetElementsByTagName("input").GetElementsByName("username")[1].InnerText = "value";
|
| | |
![]() |
| Tags |
| c# |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |