Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 2nd, 2006, 12:32 PM
Padraic Padraic is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 20 Padraic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 28 sec
Reputation Power: 0
Web Bot

Hello all,

Sorry for the multiple questions. I am fairly new to this language. Is it possible to automate submiting a form in vb.

At the moment I am getting a URL and I am traversing the files to follow links to other pages. The problem I am getting is that when i get to a page that submits a form when a button is clicked, I cannot follow this link.

If this is not possible I can get the user to manually process these pages. the problem I have then is that the session is created for the user and not the web-bot. Can a web-bot create a session?

Does anyone even know what I am talking about?

Cheers,

Padraic
.

Reply With Quote
  #2  
Old June 2nd, 2006, 09:51 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
Quote:
Does anyone even know what I am talking about?

Well, I don't, sorry

From a VB6 program you can use the webbrowser control for http, and you also can use the xmlHTTP object to "talk" to web servers.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old June 6th, 2006, 07:07 AM
Padraic Padraic is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 20 Padraic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 28 sec
Reputation Power: 0
Ok, I will explain myself better.

I am trying to create a program that will traverse a website by means of links. When I find a link i.e. <a href="">, I open this page and continue.

I am using the web transfer control to open a URL and get the source code.

The problem I am having is that to get to certain parts of the site I need to login. My question is whether it is possible to complete the login (i know the password) with my web bot.
i.e.
<code>
<form method="POST" action="page.asp">
<input type="text" id="user">
<input type="password" id="pass">
<input type="submit">
</form>
</code>

This is just a quick example of what the web bot is trying to automate.

Since I am not sure if this is possible I have another idea which might work.

Whenever these forms are encountered I could show the page to the user by means of the webbrowser control. They could complete the login manually.
The only problem then is that the session is created for the user and when I try and continue with the web bot it tells me that I have to log in.

Does that make more sense or have I made things worse?
Any answers at all are most welcome.

Cheers,
Padraic

Reply With Quote
  #4  
Old June 6th, 2006, 06:17 PM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
Quote:
Originally Posted by DougG
you also can use the xmlHTTP object to "talk" to web servers


Hmm, not recommended. Try using that object with an intelligent web server like Google and you won't like your response. The xmlHTTP object uses its own special user-agents, which some sites (like Google, and practically all online banks) do not like.

If I were you I would learn the HTTP protocol (read up on a few of the RFCs out there. Read up on HTTP/1.0 first, then move onto 1.1), then use socket based programming to connect to the web servers and carry out whatever it is that you want to do. You will have to use this method if you want to automate form posting.

You should like the HTTP protocol, its very logical, which makes it relatively simple!

Also, by using this method you can manually play about with the Cookie headers, which means that you can pass session IDs across different sockets / connections (incase you decided to make this program multithreaded, or something of the similar!)
__________________
LozWare Website Directory

Whooo! Free submissions, no recip needed. I'm a nice guy

Last edited by LozWare : June 6th, 2006 at 06:22 PM.

Reply With Quote
  #5  
Old June 7th, 2006, 06:19 AM
Padraic Padraic is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 20 Padraic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 28 sec
Reputation Power: 0
Hey Lozware,

Thanks very much. I will look into this area.

Reply With Quote
  #6  
Old June 7th, 2006, 07:33 AM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
No problem!

The following article is a really good read, and I recommend looking at it before diving into the RFCs...
http://www.jmarshall.com/easy/http/

The basic idea behind HTTP is the following...
1) The client connects to the server
2) The client sends the request (normally GET or POST)
3) The server processes the request, and sends the response.


Important: There is no other form of chatter between the client and the host. There is simply the Request (from the client) and the Response (from the server). There are no 'Send More' chunks sent out by the client. The server will just keep on sending the response until there is nothing left to send; the client just has to sit there and receive it.

Like I said, it’s a really easy protocol to learn. You should pick it up in under an hour of reading that article. And as for sockets programming...well...it's hardly challenging now is it!

Another advantage of making your app work this way is that you will use up a lot less bandwidth. Before your app would have loaded a whole webpage (which would have included downloading Images and CSS files). And because you only wanted the URLs (which are contained inside the raw HTML file), the images and CSS files would not have been needed - thus wasting a lot of bandwidth. By using sockets programming you can design your app so that it only downloads the HTML files, and nothing else.

Last edited by LozWare : June 7th, 2006 at 07:42 AM.

Reply With Quote
  #7  
Old June 7th, 2006, 01:10 PM
Padraic Padraic is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 20 Padraic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 28 sec
Reputation Power: 0
Hey LozWare,

Thanks again for the advice. I looked into socket programming and developed a small client server application. This was a simple client -server application which communicated by means of a Port.

I know a bit about HTTP from doing Networks in college. I understand the theory behind it but I have never done any programming with it.

Is mu understanding correct that I tell winsock to listen to a port and then request a html page through this port?

If this is correct how would I go about doing this, if not what should I be doing?

Cheers,
Padraic

Reply With Quote
  #8  
Old June 7th, 2006, 03:49 PM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
No. By making your application listen on a port, you are making it wait until another program connects to it - thus making it act like a server.

What you want your program to do is to connect to a remote web server. To make a program connect to another server, use the .Connect command.

Summary:

Servers Listen. So an HTTP server (like IIS for example) would Listen on port 80 and accept inbound connections made by the clients.

Clients Connect. So an HTTP client (like FireFox for example) would use the connect command to connect to a given server which is listening on port 80.

Once your client application is connected to a webserver, you can then start transfering data.

Last edited by LozWare : June 7th, 2006 at 03:53 PM.

Reply With Quote
  #9  
Old June 7th, 2006, 04:10 PM
LozWare's Avatar
LozWare LozWare is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Posts: 531 LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level)LozWare User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 10 h 56 m 31 sec
Reputation Power: 46
Send a message via MSN to LozWare
Here is a demo application that I have written in VB6 using the Winsock control.
Attached Files
File Type: zip Data Sender.zip (2.1 KB, 184 views)

Last edited by LozWare : June 8th, 2006 at 01:06 PM.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Web Bot


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT