# Script page.txt
# Get page contents into a string variable.
echo -e "DEBUG: Reading web page"
var str content ; cat "
http://yellowpages.com.au/search/postSearchEntry.do?clueType=0&clue=Real+Estate&locationClue=New+south+wales&x=55&y=14" > $content
echo -e "DEBUG: Extracting entries"
# Successively extract portions between <span id="listing-name-xxx"> and the following 3rd instance of </span>.
while ( {sen -c -r "^<span id=\"listing-name-&\"\>^" $content } > 0 )
do
# Discard the portion up to the <span id="listing-name-xxx">
stex -c -r "^<span id=\"listing-name-&\"\>^]" $content > null
# Collect the portion upto the 3rd instance of </span>.
var str entry ; stex -c "]^</span>^3" $content > $entry
# $entry now contains one entry. Portion up to 1st </span> is the name.
var str name ; stex -c "]^</span>^" $entry > $name
# Discard the portion up to <span class="address">.
stex -c "^<span class=\"address\">^]" $entry > null
# Portion up to 1st </span> is the address.
var str address ; stex -c "]^</span>^" $entry > $address
# Discard the portion up to <span class="phoneNumber">ph: .
stex -c "^<span class=\"phoneNumber\">ph: ^]" $entry > null
# The remaining portion is the phone.
var str phone ; set $phone = $entry
# Output the name, address and phone in tab separated values format.
echo $name "\t" $address "\t" $phone
done
# End of script page.txt
This is the script.Thanks for your reply.