[Pro] how to show specific section of page in iframe

using the iframe action

There is a specific section of a web page that I want visible in an iframe. Is it possible to isolate and show just that section or will the iframe always start in the upper left of the page and flow down.

If not, is there a method to show just a specific section of another external web page within a freeway page?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can’t do this with an iframe. Think of an iframe as a hole in your page, through which you can see another site.

If you want to “scrape” a particular part of another site’s page or pages, you will need a proxy application running on your server to do that. If that foreign site changes, you will need to re-write your proxy to match. But if you want a simple example, you could get a single element off of a page somewhere as easily as this:

<?php
$page = file_get_contents('http://www.apple.com/pr/index.html');
$matches = array();
preg_match('~<ul class="stories">[sS]+?</ul>~m',$page,$matches);
print $matches[0];
?>

This is an incredibly fragile thing, requiring constant checking and updating of the regular expression if the foreign page changes. Another way to get this sort of thing (and a little more ethical) is to use an RSS feed from the foreign site for your source. My ReadFeed Action can scrape a feed and convert it to an unordered list in HTML.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter. I was reading about the RSS feed method on another post here and thought that could be a valid solution. Will investigate this more fully. The page I need to show is totally controlled by me also, but is generated on another site so either way, I think I can make this work.

Thanks, you’re great.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options