Em Andamento

WebBrowser Function - Click Button Without ID - VB.NET

I need somebody to fix my function so that it will work with all types of YouTube pages - branded / unbranded / old layout / new layout. Should be an easy task for anyone with past webbrowser automation, this is not my area as I usually use sockets compared to browser methods so am not fully versed with this yet.

Code:

Private Sub WebBrowserFollowUser(ByRef newBrowser As WebBrowser, ByVal UserID As String)

' Set Variables

Dim FoundComment As Boolean = False

Dim CurTime As Integer = 0

' Reset Timeout

CurTime = 0

' Load Comments Page

[login to view URL]("[login to view URL]" & UserID)

While (True)

[login to view URL]()

If ([login to view URL] = [login to view URL]) Then

GoTo ContinueProcess001

End If

[login to view URL](100)

CurTime += 1

If CurTime >= ([login to view URL] * 10) Then Throw New Exception("Loading YouTube Comments Page Timed Out")

End While

ContinueProcess001:

' Scrape All Comments

Dim HTMLCollection As HtmlElementCollection

Try

' HTMLCollection = [login to view URL]("channel-header-main").GetElementsByTagName("button")

HTMLCollection = [login to view URL]("content").GetElementsByTagName("span")

Catch ex As Exception

Throw New Exception("Failed To Parse Comment HTML Elements For User: " & UserID)

End Try

' Loop Elements

Dim Voted As Boolean = False

Dim UnusedEles As String = ""

For Each TmpElement As HtmlElement In HTMLCollection

If Voted = True Then Exit For

' Check For Comment

If [login to view URL]("class").Contains("button-subscription-container") OrElse [login to view URL]("class").Contains("yt-uix-button-icon-wrapper") OrElse [login to view URL]("class").Contains("button-subscribe") OrElse [login to view URL]("class").Contains("subscription-button") Then

[login to view URL]()

[login to view URL]("click")

[login to view URL]()

Voted = True

End If

Next

If Voted = False Then

Throw New Exception("Unable To Find Subscribe Button")

End If

End Sub

Habilidades: Automação de Testes, Visual Basic, YouTube

Veja mais: click button without, true automation, subscribe icon, loop net, icon for button, icon button vb net, youtube header, without in, webbrowser, parse an html, id layout, check document focus, main container, net parse html, channel fix, webbrowser find, youtube sub sub, channel page youtube, net loading page, unable load user

Acerca do Empregador:
( 52 comentários ) Uckfield, United Kingdom

ID do Projeto: #4518657

2 freelancers estão ofertando em média $121 para esse trabalho

iDivya

Do read my message.

$130 USD em 1 dia
(23 Comentários)
4.8
infinityinfosys

hello.................

$111 USD in 0 dias
(0 Comentários)
0.0