Question

Aquiteus on Wed, 17 Aug 2016 15:46:10


im rather new to programming but have some knowledge on how visual basic is programmed. so i was thinking about a program that would help me fill out surveys. since many surveys have similar questions having a program that checks if that exact question is being asked and automatically fills your information in would hasten the process.

my question is would i be able to make this program in visual basic?

and if so how would i do it?

i know that  things need to be named to be referenced in the code and make them interact but how would i make it reference an open tab on my browser? and more specifically the textboxes/bullets/buttons on the page?


Sponsored



Replies

Kareninstructor on Wed, 17 Aug 2016 15:50:32


Hello,

If you are working with the web, consider an ASP.NET project.

Aquiteus on Thu, 18 Aug 2016 16:30:19


i dont have any experience in ASP.NET...

Frank L. Smith on Thu, 18 Aug 2016 16:46:33


i dont have any experience in ASP.NET...

That might not be what you meant then - that happens.

Do you want this to be an application that will utilize your web browser or is this to be a Windows Forms application?

Explain that please?

Manashty on Thu, 18 Aug 2016 17:16:54


Hi Aquiteus,

ASP.Net is a framework, it is not a language. And hopefully, you can write webpages using either Visual Basic or C# .Net language in ASP.Net. You can drag and drop textboxes, buttons, etc on a web page using Visual Studio as you can do them in regular desktop application.

Please see this old, but relevant tutorial on how to start creating web applications in Visual Studio using Visual Basic:

http://webproject.scottgu.com/VisualBasic/HelloWorld/HelloWorld.aspx

Please let me know if it helped.

Thanks

Aquiteus on Thu, 18 Aug 2016 19:15:15


@Manashty but that looks like a way to make my webpage. im looking for a way to adjust things on a webpage. for example you know how people make "bots" that post spam across the internet? how can i make one that instead of posting spam on the internet would fill in my information to survey site of my choosing?

Aquiteus on Thu, 18 Aug 2016 19:16:10


@Frank L. Smith it will utilize my browser. the survey sites im talking about are online

Frank L. Smith on Thu, 18 Aug 2016 20:57:24


@Frank L. Smith it will utilize my browser. the survey sites im talking about are online

I don't know, but this isn't the correct forum, so I now agree with Karen that you need to move this elsewhere.

This forum is for WinForms and VB Net.

Aquiteus on Thu, 18 Aug 2016 21:16:22


@Manashty that does look more to what im looking for. but from what i read from the link you provided a crawler does not seem to affect somthing you currently have open. or am i misunderstanding?

ill clarify, if i have a survey up asking me "how old are you" and "what state you live in" will a crawler fill in the blanks?

Acamar on Thu, 18 Aug 2016 22:22:45


ill clarify, if i have a survey up asking me "how old are you" and "what state you live in" will a crawler fill in the blanks?

It's not a crawler that you are looking for - that does an entirely different job.   What you are talking about is commonly used to automate repetitive procedures in web pages, such as signing in.  The problem you will have, however, is that the process assumes the web page is always the same.  If you are talking about recognizing common fields in multiple different surveys, that is probably a task that is beyond any automation.  The basic process of filling in a web page automatically is discussed in many places.  See, for example:
http://www.vbforums.com/showthread.php?416275-Manipulate-Change-Form-Fill-data-in-webpages-using-the-Webbrowser-control

Aquiteus on Thu, 18 Aug 2016 23:33:27


@Acamar thats what i was looking for. if it can be done for one webpage it can be done with another. and survey can be amazingly similar. there are some questions that are unique but i can simple do those myself the program is just for the copy paste questions that are tedious.

thank you

Acamar on Fri, 19 Aug 2016 00:06:57


@Acamar thats what i was looking for. if it can be done for one webpage it can be done with another. and survey can be amazingly similar. there are some questions that are unique but i can simple do those myself the program is just for the copy paste questions that are tedious.

It's an interesting exercise to try.  But the differences between web pages that will concern you is the internal construction, not the appearance.  If the surveys are coming from the same source, they might all be built using the same design, in which case it may be possible.   Start with one, and follow the procedure in any of those tutorials.  But when you see what is required, you might end up deciding that, despite looking similar, those pages are actually too different to be automated from the same code.

Manashty on Fri, 19 Aug 2016 13:38:11


Acamar is right. In this case, you are looking for a bot to fill in the different forms. Crawlers is not hat you want.

However, if you are looking to understand the different fields, you need to learn and understand HTML DOM (Document object model) very well first. 

http://www.w3schools.com/js/js_htmldom.asp

In a webpage, different elements are formed in a hierarchy. They can have an ID as well. For each specific webpage (the survey page you are targeting), you usually need to find the element first (they have an ID, which is a good target). You can find the ID by looking at the HTML source code. 

See this video below, in which someone did this using a couple lines of code:

https://www.youtube.com/watch?v=KKB0K3F1enU

If you are looking for an automated approach, you need to start writing your own intelligent application. Your application should look into each element, decide whether that element is part of the survey (it should not be an element at the corner of the web page), understand what it requires using machine learning algorithms. For example, you should use a machine learning algorithm to see there if there is a word "age" or "old" or "born" or "birth" in any of the following sentences:

"Please enter your age below:"

"How many children do you have?"

"Where were you born?"

As you can see, both first and third sentences are a match. But only one of them is the answer. So probably you had to search for "where" or "when" as well.

To see how you can use such algorithms, you can start from here to see what algorithm you can use in Azure machine learning:

https://azure.microsoft.com/en-us/documentation/articles/machine-learning-data-science-for-beginners-the-5-questions-data-science-answers/

You can try using key-phrase extraction as a start:

https://gallery.cortanaintelligence.com/MachineLearningAPI/Text-Analytics-2

To separate the words in VB. Net directly, you can use this code:

http://www.visual-basic-tutorials.com/Tutorials/Strings/retrieve-each-word-from-a-string-in-visual-basic.htm

Please let me know if this helped.