Fill value in Internet page

Asked

Viewed 651 times

0

So people want to put a value on a web page, but before that I log into it and I’m directed to another page, there I navigate to a different page, and I took a look at the page code and the place where I want to put the information has the name part, at first it would be like logging in the page, but for some reason I am not able to put the value in this page.

Private Sub UserForm_Activate()
Dim senha, usuario

sURL = "http://tx3.travian.com.br/" ' Navego até o site
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.navigate sURL
oBrowser.Visible = True

Do
' Espera a página carregar
Loop Until oBrowser.readyState = READYSTATE_COMPLETE

Set HtmlDoc = oBrowser.document

HtmlDoc.all.Name.Value = "" ' aqui coloco meu login
HtmlDoc.all.Password.Value = "" ' aqui coloco minha senha
HtmlDoc.all.lowRes.Click   ' clico em um botao
HtmlDoc.all.s1.Click      'click no botao de login

Do While oBrowser.Busy
DoEvents
Loop
oBrowser.navigate (sURL & ("build.php?tt=2&id=39"))    ' navego até a pagina que quero ir
Do While oBrowser.Busy
DoEvents
Loop
HtmlDoc.all.s4.Value = "4"      'É aqui o problema, quero colocar uma informacao aqui, é igual ao local onde boto minha senha e conta, mas por algum motivo dá erro. 
End Sub

What could you do here

  • Do you say the last line gives error? What mistake would be?

2 answers

1

After the lines

oBrowser.navigate (sURL & ("build.php?tt=2&id=39"))    ' navego até a pagina que quero ir
Do While oBrowser.Busy
DoEvents

you need to reload the document with:

Set HtmlDoc = oBrowser.document
  • The error unfortunately continues. The error says it does not accept this property or method. This is where I want to put <input type="text" class="text" name="t4" value="" maxlength="6"> And that code is where you put the account <input type="text" name="name" value="Bey" class="text">

0

Follow my code after "change"

`Dim password, user

Surl = "http://tx3.travian.com.br/" ' I navigate to the site

Set oBrowser = New Internetexplorer

Silent = True

oBrowser.navigate Surl

oBrowser.Visible = True

Of Wait for page to load

Loop Until oBrowser.readyState = READYSTATE_COMPLETE

Set Htmldoc = oBrowser.Document

Htmldoc.all.Name.Value = "Bey" ' here I put my login

Htmldoc.all.Password.Value = "patrick10" ' here I put my password

Htmldoc.all.lowRes.Click ' click on a button

Htmldoc.all.S1.Click 'click on login button

Do While oBrowser.Busy

Doevents

Loop

oBrowser.navigate (Surl & ("build.php?tt=2&id=39")) ' navigate to the page I want to go to

Do While oBrowser.Busy

Doevents

Loop

Set Htmldocu = oBrowser.Document

Htmldocu.all.T4.Value = "9"`

Browser other questions tagged

You are not signed in. Login or sign up in order to post.