Jump to content
Fivewin Brasil

Baixar XML


hcunha

Recommended Posts

O exemplo abaixo é um inicio, se alguém puder dar sua contribuição, agradeço. O exemplo abre site e preenche com a chave da nfe informada.

#include "fivewin.ch"

function main()
nChave:="352105......"
consulta_xml(nchave)
return .t.

function consulta_xml(f_cchave)
         local oOle, oOleDoc := Array(2)

         if empty(f_cchave)
            msgstop("Chave em branco.","Atenção")
            return nil
         endif
         f_cchave = alltrim(f_cchave)

         oOle:= CreateObject("InternetExplorer.Application")
         oOle:Visible  := .T. // Apresenta o Browser
         oOle:ToolBar  := .F. // Desativa a barra de ferramentas
         oOle:StatusBar:= .f. // Desativa a barra de status
         oOle:MenuBar  := .f. // desativa a barra de menu
         oOle:Navigate2("https://www.nfe.fazenda.gov.br/portal/consultaRecaptcha.aspx?tipoConsulta=resumo&tipoConteudo=d09fwabTnLk=")        
         WHILE oOle:Busy
             syswait(.5)
         END
         oOle := oOle:Document()
         oOle:All:Item("ctl00$ContentPlaceHolder1$txtChaveAcessoResumo",0):Value:= f_cchave
**         oOle:All:Item("recaptcha-anchor",0):Focus()
**         oOle:All:Item("ctl00$ContentPlaceHolder1$btnConsultar",0):onClick()
         oOle:=Nil

         CursorArrow()
         SysRefresh()

return nil

 

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.

Guest
Reply to this topic...

×   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.

Loading...
×
×
  • Create New...