C#的网页浏览器自动化 [英] C# Webbrowser Automation

查看:366
本文介绍了C#的网页浏览器自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:
我创建一个Windows窗体应用程序,它可以自动在企业内部网的Web应用程序订单输入。我们有大量的需要做订单输入的,这将花费我们很多钱,所以我volenteered自动执行任务。

Background: I am creating a Windows Form App that automates order entry on a intranet Web Application. We have a large amount of order entry that needs to be done that will cost us a lot of money so I volenteered to automate the task.

问题:
我使用WebBrowser类来浏览网页应用程序。很远,我已经得到了,但达到了路障。有在打开一个网页对话框页面的应用程序的一部分。我如何与Web对话框进行交互。我的web浏览器类的实例仍与父页面。我希望有人可以点我在正确的方向。

Problem: I am using the webbrowser class to navigate the web app. I have gotten very far but reached a road block. There is a part in the app that opens a web dialog page. How do I interact with the web dialog. My instance of the webbrowser class is still with the parent page. I am hoping someone can point me in the right direction.

推荐答案

您必须根据复杂的您所需要的两种选择:

You have two choices depending of the level of complexity you need:


  1. 使用一个HTTP调试如提琴手找出POST数据你
    需要通过 HttpWebRequest的。

  2. 使用一个浏览器自动化工具并做工作。

  1. Use a HTTP Debugger like Fiddler to find out the POST data you need to send to each page and mimic it via a HttpWebRequest.
  2. Use a Browser Automation Tool like Selenium and do the job.

注:您的行为可能被认为是由网站的垃圾邮件,所以要准备好IP封锁,CAPTCHA ...

NOTE: Your action may be considered as spamming by the website so be ready for IP blocking, CAPTCHA...

这篇关于C#的网页浏览器自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆