hcunha Posted September 6, 2021 Report Share Posted September 6, 2021 Ola senhores, Alguem tem alguma solução pra baixar os XMLs direto da sefaz ? Quote Link to comment Share on other sites More sharing options...
mkyx Posted September 7, 2021 Report Share Posted September 7, 2021 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.