Extracting data from IFRAME

IFRAMEs are an old part of HTML spec and are not commonly used these days. But sometime you still encounter them they cause  a lot pain to deal with. In this post we will show 2 common cases of handling IFRAMEs with Data Miner.

  1. Case 1: The bulk of a website is enclosed in an IFRAME
  2. Case 2: An element on the page is enclosed in an IFRAME


The main problem: Content inside an IFRAME are isolated from the parent page and are not accessible Javascript running inside the parent page.


But there are a few hacks to get around the IFAME page isolation.


Case 1: The bulk of a website is enclosed in an IFRAME

Sometime it is possible to bypass the IFRAM entirely if you just find the URL of the frame that you are interested in and load that frame on its own as a new tab.

For example:   http://www.iframehtml.com

The page above contains an IFRAME. But it is possible to load the content of the frame independently by looking at the SRC attribute.

< iframe src=”page-1.htm” name=”test” height=”120″ width=”600″>You need a Frames Capable browser to view this content.< /iframe >

So we can independently load the frame page by open a new tab with this URL:  http://www.iframehtml.com/page-1.htm

Read More »