JavaEar 专注于收集分享传播有价值的技术资料

Is it possible to convert iframe to html?

Is it possible to use PHP to convert an iFrame into on-page HTML (if that makes any sense) so that the content can be indexed by search engines? I am using a spreadsheet here:

http://www.landedhouses.co.uk/offers/

<p><iframe width='700' height='1200' frameborder='0' src='https://docs.google.com/spreadsheet/pub?key=0Ai0rAM-RzQC4dE1hQ2FpdmFoU29POGFUR1NMQUl2RWc&#038;single=true&#038;gid=1&#038;output=html&#038;widget=true'></iframe></p>

2个回答

    最佳答案
  1. To pull HTML using PHP, you can use the file_get_contents function:

    $html = file_get_contents('https://docs.google.com/spreadsheet/pub?key=0Ai0rAM-RzQC4dE1‌​hQ2FpdmFoU29POGFUR1NMQUl2RWc&#038;single=true&#038;gid=1&#038;output=html&#038;wi‌​dget=true');
    
  2. 参考答案2
  3. Search engines will follow the URL inside an IFrame, unless it is forbidden by either robots.txt or meta tags.

    It is difficult to include the HTML into an existing page, because at least the <head> and part of the <body> have to be removed, and probably the stylesheet fixed.