Jump to content
Fórum Script Brasil
  • 0

busca na web



boa tarde!

estou tentando criar uma macro que entre em um site insira alguns parâmetros e me  retorne o resultado na planilha e isso sera feito automático a casa 5 min. porem comecei com a parte em que a planilha acesse o site e insira os dados porem quando faco o teste com o "F8"  ele apresenta um erro no primeiro parâmetro a ser inserido.

poderiam me ajudar.

Sub monitoramento()

Set ie = CreateObject("internetexplorer.application")

ie.navigate "http://sitedesejado/"
ie.Visible = True

Do While ie.busy And ie.readyState <> "READYSTATE_COMPLETE"

ie.document.getElementsByTagName("td")(0).Value = Cells(2, 2).Value( aqui aparece o erro de "91" agluma coisa haver com with)

ie.document.getElementsByTagName("td")(1).Value = Cells(2, 4).Value


End Sub

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Tenta usar esse comando:

Sub GrabLastNames()

    'dimension (set aside memory for) our variables
    Dim objIE As InternetExplorer
    Dim ele As Object
    Dim y As Integer
    'start a new browser instance
    Set objIE = New InternetExplorer
    'make browser visible
    objIE.Visible = True
    'navigate to page with needed data
    objIE.navigate "https://seu site"
    'wait for page to load
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
    'we will output data to excel, starting on row 1
    y = 1
    'look at all the 'tr' elements in the 'table' with id 'myTable',
    'and evaluate each, one at a time, using 'ele' variable
    For Each ele In objIE.document.getElementsByTagName("title")
        'show the text content of 'tr' element being looked at
        Debug.Print ele.textContent
    'repeat until last ele has been evaluated

    'save the Excel workbook

End Sub


Link to comment
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.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...