Solved

How can i read Frame content with TWebBrowser?

Posted on 2007-11-20
6
1,318 Views
Last Modified: 2012-06-27
Hello

im making a software for my company and i need to read the frame content (wich are from other domains) and assign them to a var. Im using TWebBrowser component since it interpret js code, but im getting "access is denied" error due to cross domain security. How can i bypass it? and if its not possible is there any component wich will allow me to read the frame content (the component MUST execute js code).

Thanks a lot.

Elias
procedure TForm1.Button1Click(Sender: TObject); 

var

  i: integer; 

begin 

  for i := 0 to (WebBrowser1.OleObject.Document.frames.Length - 1) do 

    if WebBrowser1.OleObject.Document.frames.item(i).document.queryCommandEnabled('Copy') then 

      ShowMessage('copy command is enabled for frame no.' + IntToStr(i));

end;

Open in new window

0
Comment
Question by:epagos
6 Comments
 
LVL 14

Expert Comment

by:B_Dorsey
ID: 20322434
Is it login data from the frame window? For instance the data on the page you are trying to scrape is user login based? If not I just have my server call the frame url and grab the data via xmlhttp (ASP) or anoter way via some other server side language... if its login based, I think you are SOL.
0
 

Author Comment

by:epagos
ID: 20322894
no, its login based.
And yes i have tried to retrieve frames url through another browser request. But on this case i must get the code WITHOUT any additional requests.
0
 
LVL 10

Expert Comment

by:wildzero
ID: 20325434
You might want to check this out
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21214157.html

It's a bit of a read, but worth it.
:-)
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 20329233
[quote]But on this case i must get the code WITHOUT any additional requests.[/quote]
IMPOSSIBLE with security. You can use XMLHTTP but you must pass authorization info in your request.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21066695
Forced accept.

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now