我正在尝试编写一个自动填充外部网页内文本框的代码。所以我在 buttonclick 事件内部编写代码,我想要它做的是,只需加载外部网页并用文本填充现有文本框。但是,我无法正常工作。它根本不设置任何内容。
String Url2dehands = "http://www.hereisthewebsite.be";
HtmlWeb mvWeb = new HtmlWeb();
HtmlDocument doc = mvWeb.Load(Url2dehands);
HtmlNode mvTextBox = doc.DocumentNode.SelectSingleNode("//input[@id='id_ofthe_textbox']");
mvTextBox.InnerHtml= "assdsda";
最佳答案
我想你需要的可能是http://docs.seleniumhq.org/
Selenium automates browsers. That's it. What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
此外,您可以使用 Selenium IDE . 这将以一组不同的语言为您编写代码。然后,您可以使用此代码自动执行该过程。
关于c# - 使用 Agility Pack 设置外部加载网页的文本框内部文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16481317/