title: Getting all iframes,base64 codes which are present in html pages using crawler4j
body: <p>I am using crawler4j for crawling some websites and it is working fine. I am able to download all the files present in a website and now I have a new task ahead of me.I need to extract iframe,base64 and other embedded codes also if possible!</p>
  <p>Till now what i am doing is, in my visit method</p>
  <pre><code> String place=&quot;&lt;iframe&quot;;
   if (page.getParseData() instanceof HtmlParseData) {
                   HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();
                   String text = htmlParseData.getText();
                   String html = htmlParseData.getHtml();
                   List&lt;WebURL&gt; links = htmlParseData.getOutgoingUrls();
                   System.out.println(&quot;Text length: &quot; + text.length());
                  // System.out.println(&quot;html sorce code:- &quot;+html);
                   int number=html.length();
                   String[] result=html.split(&quot;\\s&quot;);
                   System.out.println(&quot;print random word&quot;+result[12500]+number);
                   int i;
                   for(i=0;i&lt;number;i++)
                   {
                       if(result[i].equals(place))
                       {
                           System.out.println(&quot;iframe found&quot;+i);
                       }
                   }
                   System.out.println(&quot;Text length: &quot; + text.length());
                   System.out.println(&quot;Html length: &quot; + html.length());
                   System.out.println(&quot;Number of outgoing links: &quot; + links.size());
                   }
  </code></pre>
  <p>I have added the above if case to get the iframes of the given html page.It is working almost near to perfect.</p>
  <p>I know that this is a bad way of extracting of iframes from  a html page.I tried many other ways to extract iframes and other embedded codes from html pages but failed.After going through the source code I found a <a href="http://code.google.com/p/crawler4j/issues/attachmentText?id=105&amp;aid=1050006001&amp;name=HtmlContentHandler.java&amp;token=ABZ6GAe1xcuhdakm-q2VUN0kHxlS4oYggg%3A1418635375168" rel="nofollow noreferrer">java class</a> which can satisfy my requirement.As you can see from the url above I have to call startElemnt method using necessary parameters in the HtmlContentHandler class inorder to get the required codes.</p>
  <pre><code>`public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException` 
  {
  }
  </code></pre>
  <p>So In my visit  method I have created a HtmlContentHandler object and tried to call the startElement method mentioned above.</p>
  <pre><code>HtmlContentHandler ecode=new HtmlContentHandler();
   ecode.startElement(url,localName,qName,attributes);
  </code></pre>
  <p>Now the problem is with parameters of that method. I am sending the url value that is crawled
  for the url parameter and I have no idea what values I have to sent for the rest of the parameters!</p>
  <p>Can some one help me in this? One more thing I know that many other tools can make my work easy but I want to do this in crawler4j instead!</p>
  <p>Thank you!!</p>