如何以编程方式浏览页面?
我见过很多关于如何获取 URI 内容的示例。我也经常使用 HTMLAgilityPack。 我想要的是为asp网站创建单元测试环境。
我看过 BrowserSession这个问题但是,尽管过程看起来不错,但他们不要登录网站。我尝试了很多知名网站。
关于如何浏览代码有什么想法吗?
I've seen numerous examples on how to get the contents of a URI. I also used HTMLAgilityPack a lot.
What I want is to create Unit Testing environment for asp websites.
I've seen the BrowserSession and this Question but although, the process seems fine, they do not login in a website. I tried numerous well-known websites.
Any ideas on how to browse though code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您想在网页上提交表单并查看结果页面的响应 HTML。
此方法将采用表单目标 URL 并使用 parms 字典中给定的命名参数提交帖子。
我使用下面的方法在网页上进行密码验证并查看验证后的响应。您需要知道目标 URL 以及您希望在请求中传递的表单字段。
如果您想要更具体的东西,或者这不是您想要的,请发表评论。
It sounds like you want to submit a form on a web page and view the response HTML back of the resulting page.
This method will take a form target URL and submit a post with the given named arguments in the parms Dictionary.
I have used the method below to perform password authentication on a web page and view the response after authentication. You will need to know the target Url and the form fields you wish to pass in the request.
If there is something more specific you are wanting or this is not what you are looking for then please post a comment.
我的建议是尝试一些 WebDriverJs 教程,看看是否适合您。它主要用于测试,但也可用于其他目的。我正在使用它来自动响应购物平台上的用户查询。
My suggestion is to try some tutorials of WebDriverJs and see if that works for you. It is mainly used for testing but can also be used for other purposes. I am using it to automate responding to user's queries on a shopping platform.