Hi all!
I catch the Source code of a website using Javascript with HTMLViewer, and in the code, I need to get the “Onclick” attribute of label, like this: ">
The issue. is that obviously this value always be different, because theres a lot of links on the source code.
I thought on InStr. but I think Instr Only work for a certain text, wright?
Dim source as String = [YOUR SOURCE]
s = NthField(NthField(source, "onclick=""", 2), ";""", 1)
You do know that you can easily get the HTML source of a page using a socket instead of getting it from an HTMLViewer? ;)[/quote]
Sure? Is it possible. Wow, How did you do get the source with a socket?
This is also pseudo code, but it might work.
Inspect ‘resultArr’ array on the ‘break’.
source = your source text
Dim count as Integer
Dim resultArr() as String
count = CountFields(source, "onclick=")
For i as Integer = 1 to count -1
resultArr.Append NthField(NthField(source, "onclick=""", i+1), ";""", 1)
Next
Break
That pre-supposes that the HTML one is dealing with has come from a web site. Suppose it comes from an email? Is there a method I can use to get the serialised HTML back from an HTMLViewer? At least that would give HTML that webkit had cleaned up and corrected, thus making it more reliable to parse.
Dim source as String = [YOUR SOURCE]
s = NthField(NthField(source, "onclick=""", 2), ";""", 1)
You do know that you can easily get the HTML source of a page using a socket instead of getting it from an HTMLViewer? ;)[/quote]
Of course I know that is possible to get the source code with an HTTPSocket.
In my case I need an HTTPSecureSocket, and pass the cookie to the HeaderRequest.
Doing this, Yes I get the source code.
But When I get source code with socket. I only get a part of code.
When I get through javascript. I get all the source code including javascript
[quote=231560:@Christian Schmitz]did you see the HTMLViewer extensions in MBS Plugin?
They allow you to execute javascript on the page.[/quote]
Are there examples of How-to use In the Folder “Examples”?
[quote=231541:@Beatrix Willius]Parsing html is done way easier with the Tidy plugin from the MBS plugins. With this you can clean up the html in one line of code.[/quote]in which folder are Tidy plugin examples?
Thanks