j.neto233 Posted February 2, 2015 Posted February 2, 2015 I need automatically fill in web forms, fill in the fields, perform the functions of the buttons, logging in automatically on a page. must also read the result of a form. In Delphi i use the TWebBrowser that does the job perfectly. I'm having trouble using the TUniURLFrame. someone help me, or know if it is possible to do this with TUniURLFrame? In Delphi with TWebBrowser works well: sample: PROCEDURE TForm1.Button1Click(Sender: TObject); VAR Doc3: IHTMLDocument3; BEGIN WebBrowser1.Navigate('https://pt-br.facebook.com/'); Doc3 := Webbrowser1.Document AS IHTMLDocument3; Doc3.getElementById('email').setAttribute('value', 'neto@hotmail.com', 0); Doc3.getElementById('pass').setAttribute('value', 'pAsswOrd', 0); WebBrowser1.OleObject.Document.all.Item('loginbutton', 0).click; WebBrowser1.Silent; END; Anyone have any idea how to do this UniGUI? 1 Quote
Administrators Farshad Mohajeri Posted February 2, 2015 Administrators Posted February 2, 2015 Send a simple project please. Quote
Oliver Morsch Posted February 2, 2015 Posted February 2, 2015 You can access content of TUniUrlFrame (= iframe) only if the content uses the same server and port as your webapp, otherwise it it is blocked by the browser (security issue). Quote
j.neto233 Posted February 2, 2015 Author Posted February 2, 2015 the attachment, this in Delphi XE2, but I think that works on anyone. Example, I log on google account after I capture the value of the "name profile" thank you agai TwebBrowser.rar Quote
Administrators Farshad Mohajeri Posted February 3, 2015 Administrators Posted February 3, 2015 If you plan to use UniUrlFrame with Google or similar sites it is not possible for security reasons: http://stackoverflow.com/questions/22124060/why-cant-iframe-work-with-google-gmail-facebook Quote
j.neto233 Posted February 3, 2015 Author Posted February 3, 2015 Okay, I think even that will not work, thank you Quote
juniorcsa Posted June 5, 2015 Posted June 5, 2015 How to obtain the html code of a page open in UniURLFrame1.URL.example:// Loading the siteUniURLFrame1.URL:='http://www.nfe.fazenda.gov.br/portal/consulta.aspx?tipoConsulta=completa&tipoConteudo=XbSeqxE8pl8='// Getting html code site after being loadedUniMemo1.text: = UniURLFrame1.html.text;My problem is getting the code, someone can help me with this? 1 Quote
Administrators Farshad Mohajeri Posted July 4, 2015 Administrators Posted July 4, 2015 It is not something that is easilly achievable. What is your main purpose to use this function? Quote
Ron Posted July 16, 2015 Posted July 16, 2015 I needed a phone number lookup function, so I used an Indy http client component to GET the html file from the phone lookup site, and then made a very simple parsingprocedure to extract the phone/user info. I guess you could do the same, even extract all links and get them too, like cssand images etc. I dont see the reason to use urlframe to get only the html file itself, asyou then also have the visual presentation taking up resources. Compared to this,the resource use by only downloading may be much smaller, esp. if media is involved. uses IdHTTP; ... function getUrl(aURL: string): string; const cUSER_AGENT = 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)'; var IdHTTP: TIdHTTP; Stream: TStringStream; begin Result := ''; IdHTTP := TIdHTTP.Create(nil); Stream := TStringStream.Create; try IdHTTP.Request.UserAgent := cUSER_AGENT; try IdHTTP.Get(aURL, Stream); Result := Stream.DataString; except Result := ''; end; finally Stream.Free; IdHTTP.Free; end; end; URLFrame.zip Quote
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.