如何自动将大量数据输入公共网站 [英] How to automatic input a large amount of data into a public website

查看:129
本文介绍了如何自动将大量数据输入公共网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过VC6.0将大量数据输入公共查询网站。主要工作在网页的主页上,用HTML编写。输入的用户名和代码有2个文本框和一个OK按钮。我有很多用户名和代码,但它很累,逐个输入它们。



现在我想写一个VC程序来实现自动输入。输入数据的问题是数据由10位数组成,包括5位常数和5位变量。我想输入一个数据,以设定的间隔改变5个变量,例如0.5秒。输入数据后,目标网站将弹出一个网页并显示查询结果。现在我想手动记录结果。



如果你有好主意,请教我,谢谢你。

I want to input a large amount of data into a public inquiry website by VC6.0. The main work is on the home page, written with HTML, of the website. There are 2 text boxes where user names and codes inputted in and an OK button. I have many user names and codes but it''s very tired input them one by one.

Now I want to write a VC program to realize automatic inputting. The problem on data inputted is that the data is made up by 10 digits including 5 constant and 5 variable. I wanna input a data with changing 5 variables at set intervals, for example 0.5 second. After inputting a data, the target website will pop up a webpage and display query results. Now I wanna manually record the results.

If you have good ideas please teach me, thank you sincerely.

推荐答案

这根本不是关于HTML的。显然,由于这是一个网站,您必须遵循HTTP协议。您需要以与浏览器完全相同的方式发送HTTP请求,最有可能使用POST请求方法。这不是问题,因为你总能看到网页的作用(它是什么,HTML表单或Ajax?必须是一个或另一个)。



根据这个答案,你可以使用的其中一个类是 CInternetSession http://stackoverflow.com/questions/8563975/how-to-http-post-to-a-web-form-using- c-mfc [ ^ ]。



参见: http://msdn.microsoft.com/en-us/library/cttkhz64%28v=vs.80%29.aspx [ ^ ]。



希望它可用并在VC 6.0中工作:-)。



或者,你可以使用此CodeProject文章中提供的包装:全功能Windows C ++中的HTTP Wrapper [ ^ ]。



-SA
This is not about HTML at all. Apparently, as this is a Web site, you have to follow HTTP protocol. You need to send HTTP request in exact same way you browser does, most likely using "POST" request method. This is not a problem, because you can always see what a Web page does (what is it, an HTML form or Ajax? must be either one or another).

One of the classes you can possibly use is CInternetSession, according to this answer: http://stackoverflow.com/questions/8563975/how-to-http-post-to-a-web-form-using-c-mfc[^].

See also: http://msdn.microsoft.com/en-us/library/cttkhz64%28v=vs.80%29.aspx[^].

Hope it was available and worked in VC 6.0, too :-).

Alternatively, you can use the wrapper provided in this CodeProject article: A Fully Featured Windows HTTP Wrapper in C++[^].

—SA


这篇关于如何自动将大量数据输入公共网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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