Hi all,
I'm new here so sorry if my question is placed in the wrong sub-forum.
I'm busy with programming a program for one of my websites.
The function will automaticly choose the categories that the user chose in the program. So the user is not interacting with the website just the program.
What I want when the user clicks "publish" the program will search in the webbrowser for the first category(that the customer chose in program) and click on it, then waits till the second category is loaded(in the webbrowser) and click on the second category and then wait on the third category(in the webbrowser) till its loaded and click on the third category.
Now I tried Thread.Sleep to wait but it stops the whole program
Here is my code of the click event:
I would really appreciate if somebody could help me out, I have tried to google it and it gave me no succes.
Thanks in future
Best regards,
Predricted
I'm new here so sorry if my question is placed in the wrong sub-forum.
I'm busy with programming a program for one of my websites.
The function will automaticly choose the categories that the user chose in the program. So the user is not interacting with the website just the program.
What I want when the user clicks "publish" the program will search in the webbrowser for the first category(that the customer chose in program) and click on it, then waits till the second category is loaded(in the webbrowser) and click on the second category and then wait on the third category(in the webbrowser) till its loaded and click on the third category.
Now I tried Thread.Sleep to wait but it stops the whole program
Here is my code of the click event:
Code:
Private Sub button_add_publish_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_add_publish.Click
Dim allelements As HtmlElementCollection = webbrowser_global.Document.All
Dim SubcategoryTimer As Integer = 0
For Each webpageelement As HtmlElement In allelements
If webpageelement.GetAttribute("data-val") = label_add_category_id.Text Then
webpageelement.InvokeMember("Click")
End If
If webpageelement.GetAttribute("data-val") = label_add_subcategorie_id.Text Then
webpageelement.InvokeMember("Click")
End If
If webpageelement.GetAttribute("data-val") = label_add_subcategorie2_id.Text Then
webpageelement.InvokeMember("Click")
End If
Next
End Sub
Thanks in future
Best regards,
Predricted