Jump to content
programadorvb6

Como pressionar automáticamente no botão de uma página.

Recommended Posts

programadorvb6

Olá boa noite.

Estou a tentar com que a função em baixo, efectue um "Click" no botão de uma página de internet, mas não estou a conseguir.

Alguém me pode ajudar?

Código HTML = <input tabIndex="3" class="input_submit" type="submit" value="Entrar"/>

Função:

Public Sub Motor_Login()		  
		Dim objIE As SHDocVw.InternetExplorer
		Dim htmlDoc As mshtml.HTMLDocument
		Dim DocElements As mshtml.IHTMLElementCollection = Nothing
		Dim urlx As String
		urlx = "http://www.portugal-a-programar.pt/index.php?app=core&module=global&section=login"
		objIE = New SHDocVw.InternetExplorer
		With objIE
			htmlDoc = .Document
			DocElements = htmlDoc.getElementsByTagName("className")
			While .Busy = True
				Threading.Thread.Sleep(2000)
			End While
			For Each i As mshtml.IHTMLElement In DocElements
				If i.value = "input_submit" Then
					i.InvokeMember("click")
				End If
			Next i
		End With
end sub

Grato desde já pela vossa atenção.

Atentamente.

Programadorvb6

Edited by programadorvb6

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.