Edu Posted January 3, 2014 Report Share Posted January 3, 2014 Prezados, bom dia! Gostaria de saber se há um jeito de preencher campos de uma página na web através da url ou do código fonte. Pesquisei mas só achei no delphi, que faz através do TWebBrowser. Quote Link to comment Share on other sites More sharing options...
sistem Posted January 3, 2014 Report Share Posted January 3, 2014 qual seria a pagina? Function CnpjSintegra(cCgc, cEst) Local hWnd, oOle, cUrl, cCnpj:=Alltrim(StrTran(StrTran(StrTran(cCgc, "/", ""), ".", ""), "-", "")) 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 If cEst="AC" cUrl:="http://sefaznet.ac.gov.br/sefazonline/servlet/sintegraconsulta" ElseIf cEst="AL" cUrl:="http://sintegra.sefaz.al.gov.br/consulta_empresa_pesquisa.asp" ElseIf cEst="AP" cUrl:="http://www.sintegra.ap.gov.br/Sintegra/" ElseIf cEst="AM" cUrl:="http://online.sefaz.am.gov.br/sintegra/index.asp" ElseIf cEst="BA" cUrl:="http://www.sefaz.ba.gov.br/sintegra/sintegra.asp?estado=BA" ElseIf cEst="CE" cUrl:="http://www.sefaz.ce.gov.br/content/aplicacao/internet/servicos_online/sintegra/sintegra.asp?estado=ce" ElseIf cEst="DF" cUrl:="http://www.fazenda.df.gov.br/area.cfm?id_area=110" ElseIf cEst="ES" cUrl:="http://www.sintegra.es.gov.br/" ElseIf cEst="GO" cUrl:="http://www.sefaz.go.gov.br/ccs/default.asp" ElseIf cEst="MA" cUrl:="http://sistemas.sefaz.ma.gov.br/sintegra/jsp/consultaSintegra/consultaSintegraFiltro.jsf" ElseIf cEst="MT" cUrl:="http://www.sefaz.mt.gov.br/sid/consulta/infocadastral/consultar/publica" ElseIf cEst="MS" cUrl:="http://www1.sefaz.ms.gov.br/cadastro/CadastroMsCCI.asp" ElseIf cEst="MG" cUrl:="http://consultasintegra.fazenda.mg.gov.br/sintegra/" ElseIf cEst="PR" cUrl:="http://www.sintegra.fazenda.pr.gov.br/sintegra/" ElseIf cEst="PB" cUrl:="https://saplic.receita.pb.gov.br/sintegra/SINf_ConsultaSintegra.jsp" ElseIf cEst="PA" cUrl:="https://app.sefa.pa.gov.br/Sintegra/" ElseIf cEst="PE" cUrl:="http://www.sintegra.sefaz.pe.gov.br/" ElseIf cEst="PI" cUrl:="http://web.sintegra.sefaz.pi.gov.br/consulta_empresa_pesquisa.asp" ElseIf cEst="RJ" cUrl:="http://www.fazenda.rj.gov.br/projetoCPS/consulta.jsp" ElseIf cEst="RN" cUrl:="http://www.set.rn.gov.br/sintegra/default.asp" ElseIf cEst="RS" cUrl:="http://sintegra.sefaz.rs.gov.br/sef_root/inf/Sintegra_Entrada.asp" ElseIf cEst="RO" cUrl:="http://portal.intranet.sefin.ro.gov.br/PortalContribuinte/Publico/parametropublica.jsp" ElseIf cEst="RR" cUrl:="https://www.sefaz.rr.gov.br/sintegra/servlet/hwsintco" ElseIf cEst="SC" cUrl:="http://sistemas3.sef.sc.gov.br/sintegra/consulta_empresa_pesquisa.aspx" ElseIf cEst="SE" cUrl:="https://security.sefaz.se.gov.br/SIC/sintegra/index.jsp" ElseIf cEst="SP" cUrl:="http://pfeserv1.fazenda.sp.gov.br/sintegrapfe/consultaSintegraServlet" ElseIf cEst="TO" cUrl:="http://sintegra.sefaz.to.gov.br/" Else Return nil Endif oOle:Navigate(cUrl) hWnd:=oOle:hWnd ShowWindow(hWnd, 1 ) //SW_MAXIMIZE=3 SW_NORMAL=1 SW_MINIMIZE=6 BringWindowToTop(hWnd) While oOle:Busy syswait(.2) End oOle := oOle:Document() If cEst="AC" oOle:All:Item("vNUMDOC",0):Value := cCnpj oOle:All:Item("cfield",0):Focus() ElseIf cEst="AL" oOle:All:Item("txt_CNPJ",0):Value := cCnpj oOle:All:Item("Submit",0):Focus() oOle:All:Item("Submit",0):Click() ElseIf cEst="AP" oOle:All:Item("j_id4:tipo",0):Value := "CNPJ" oOle:All:Item("j_id4:doc",0):Value := cCnpj oOle:All:Item("j_id4:txtcaptcha",0):Focus() ElseIf cEst="AM" oOle:All:Item("cgc",0):Value := cCnpJ oOle:All:Item("captcha_code",0):Focus() ElseIf cEst="BA" oOle:All:Item("txt_CNPJ",0):Value := cCnpj oOle:All:Item("Submit",0):Focus() oOle:All:Item("Submit",0):Click() ElseIf cEst="CE" oOle:All:Item("CGC",0):Value := cCnpj oOle:All:Item("B1",0):Focus() oOle:All:Item("B1",0):Click() ElseIf cEst="DF" oOle:All:Item("CGC",0):Value := cCnpj oOle:All:Item("B1",0):Focus() oOle:All:Item("B1",0):Click() ElseIf cEst="ES" oOle:All:Item("num_cnpj",0):Value := cCnpj oOle:All:Item("botao",0):Focus() oOle:All:Item("botao",0):Click() ElseIf cEst="GO" // GO erro // oOle:All:Item("tCNPJ",0):Value := cCnpj // oOle:All:Item("btCGC",0):Focus() // oOle:All:Item("btCGC",0):Click() ElseIf cEst="MA" // MA erro // oOle:All:Item("tipoEmissao",0):Value := "2" // oOle:All:Item("cpfCnpj",0):Value := cCnpj // oOle:All:Item("j_id23",0):Focus() ElseIf cEst="MT" oOle:All:Item("numero",0):Value := cCnpj oOle:All:Item("captchaDigitado",0):Focus() ElseIf cEst="MS" oOle:All:Item("CGC_CPF",0):Value := cCnpj oOle:All:Item("captchacode",0):Focus() ElseIf cEst="MG" oOle:All:Item("identificadorCmbOpcao",0):Value := "Número do CNPJ" oOle:All:Item("filtro",0):Value := cCnpj oOle:All:Item("recaptcha_response_field",0):Focus() ElseIf cEst="PR" oOle:All:Item("data[Sintegra1][Cnpj]",0):Value := cCnpj oOle:All:Item("data[Sintegra1][CodImage]",0):Focus() ElseIf cEst="PB" oOle:All:Item("nrDocumento",0):Value := cCnpj oOle:All:Item("B1",0):Focus() oOle:All:Item("B1",0):Click() ElseIf cEst="PA" oOle:All:Item("CNPJ",0):Value := cCnpj oOle:All:Item("OP",0):Focus() oOle:All:Item("OP",0):Click() ElseIf cEst="PE" oOle:All:Item("CNPJ",0):Value := cCnpj // problema oOle:All:Item("ConsultaCGC",0):Focus() oOle:All:Item("ConsultaCGC",0):Click() ElseIf cEst="PI" oOle:All:Item("txt_CNPJ",0):Value := cCnpj oOle:All:Item("Submit",0):Focus() oOle:All:Item("Submit",0):Click() ElseIf cEst="RJ" oOle:All:Item("CGC",0):Value := cCnpj oOle:All:Item("cod_img",0):Focus() ElseIf cEst="RN" oOle:All:Item("CGC",0):Value := cCnpj oOle:All:Item("B1",0):Focus() oOle:All:Item("B1",0):Click() ElseIf cEst="RS" oOle:All:Item("cgcmf",0):Value := cCnpj ElseIf cEst="RO" oOle:All:Item("NuDevedor",0):Value := cCnpj oOle:All:Item("recaptcha_response_field",0):Focus() ElseIf cEst="RR" oOle:All:Item("_CONINSESTG",0):Value := cCnpj oOle:All:Item("cfield",0):Focus() ElseIf cEst="SC" oOle:All:Item("txt_CPFCNPJ",0):Value := cCnpj oOle:All:Item("txtCodigoCaptcha",0):Focus() ElseIf cEst="SE" oOle:All:Item("cdCnpj",0):Value := cCnpj oOle:All:Item("dsImagem",0):Focus() ElseIf cEst="SP" oOle:All:Item("cnpj",0):Value := cCnpj oOle:All:Item("Key",0):Focus() ElseIf cEst="TO" oOle:All:Item("CGC",0):Value := cCnpj oOle:All:Item("B1",0):Focus() oOle:All:Item("B1",0):Click() Endif oOle := NIL Return nil segue exemplo de preencher na pagina do sintegra Quote Link to comment Share on other sites More sharing options...
Edu Posted January 6, 2014 Author Report Share Posted January 6, 2014 A página é a do provedor WebIss que tem a funcionalidade de emitir notas fiscais de serviços eletrônica - NFS-e. Eu queria preencher 03 campos desta página para consultar a nota gerada. Segue o link abaixo: http://www3.webiss.com.br/rjniteroi/FormVerificarNFE.aspx?Login=ANONIMO&idRec=verificarnfse&tipo= Todavia, obrigado por sua resposta. Será de grande valia! 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.