How to fill a textbox from a website using webbrowser - vb.net

I'm new at Visual Basics and I'm trying to fill the forms of the following website:
http://www3.dataprev.gov.br/cws/contexto/hiscre/
I tried using this line of code:
WebBrowser1.Document.GetElementById("nome").SetAttribute("Value", "Test")
However, whenever I try I got the following error:
A first chance exception of type 'System.NullReferenceException'
occurred.
I would appreciate if someone could help me to accomplish this, it would save me a lot of time if I could automate this task.
Thank you in advance, Daniel.

WebBrowser1.Document.GetElementById("nome").InnerText = Test
That will select the input named "nome" and fill it with the text "Test"
Hope this helps.

According to Microsoft documentation, the SetAttribute function your are using is case sensitive.
You'll need to replace "Value" for "value".
WebBrowser1.Document.GetElementById("nome").SetAttribute("value", "Test")
However, the kind of error message you are getting seems to occur before the call to the SetAttribute function. Go in debug mode and make sure that every objects used before the SetAttribute function are not null.

You need to be using a combination of WebClient and HtmlAgilityPack. See these examples:
How can I download HTML source in C#
How to use HTML Agility pack

Related

UWP Databinding Error

In a UWP, I use the "CollectionViewSource" in a xaml file, and when I want to bind the source for it, it doesn't work and the error information is
Input string was not in correct format
What can I do for solving this problem ?
You have to parse the json file into a collection from the corresponding type, then bind to that collection.
Hope it helps you out.

navigationservice.navigate not available on the vs2013 project

I have two page application and the main page is default is "MainPage.xaml" and the second one is "AddPerson.xaml" when user click a button on main page I want the app to take user to "AddPerson" page.
And I wrote following for the Click event of the button
Me.Frame.Navigate(System.Type.GetType("AddPerson.xaml"))
and I am getting the following error
An exception of type 'System.NullReferenceException' occurred in MedicineSchedule.exe but was not handled in user code
Additional information: Object reference not set to an instance of an object.
If there is a handler for this exception, the program may be safely continued.
I tried other method of navigationservice.navigate which I cannot find the class in VS2013 express at all. The only method available is Me.Frame.Navigate in my project, please let me know how I can get this simple thing to work.
If it was .net 2.0 I would simple called new form with form.lod or something similar.
This doesn't work?
this.Frame.Navigate(typeof(AddPerson));
If you want/have to use a string take a look at the reply here:
convert string to type of page

IE9 defineGetter Error Terraformer.js

I have an MVC4 application I am working on and each time I try and run it in IE9 I get an error saying:
SCRIPT438: Object doesn't support property or method 'defineGetter'
terraformer.js, line 1007 character 5
this is the line of code getting the error:
this.__defineGetter__("bbox", function(){
return calculateBounds(this);
});
}
i am trying to create a new incident from a properties dialog box but it will not let me continue. it works fine in crome. i dont know why it keeps going to this terraformer.js file too. i am really new to all this coding so any help or advice will be greatly appreciated. someone told me i can try to update the terraformer file but im not sure how to do that. i really hope someone can help me move forward with this issue.
thank you in advance.
i just needed to update the terraformer code from github with an updated version. doing this fixed the problem and now i get no errors.

Errors for using HPPLE Html parser

i am trying to use HPPLE parser but i get these errors! anyone can help me for example why NASData cant has error ?
You need to put your code inside of some function. If you are making a command-line tool this would usually be main(). Otherwise you'll have to set up an interface, application delegate, etc.

According to Datatype,Dynamically Create Control & Using those Control

I want to do a application in silverlight that contains follwing things
According to the datatype it receive from the class(which i am giving through wcf service)
it should create the control.
If it encounters string then a text box should be created dynamically.
If it encounters bool then a radiobutton should be created.
I want to acess those dynamically created controls.(as name is no static to refer in FindName())
How can i achive that.
Please help me with any related link or any code.
Thanks
In WPF, there's something called TemplateSelector, which does what you're asking for. In Silverlight, you have to write it yourself. This should help you.