Page 1 of 1

find phone number and create hyperlink from it

Posted: Tue Jul 08, 2008 1:42 pm
by jeremyn
hi all, im new to this so please be nice :)
I am looking for a way to find phone numbers which appear on any web page thank then create a url form them. eg imagine that on a web page the phone number (03) 1234 1234 appeares the macro would find it and allow a user to click it and it would load a url being http://10.0.0.1/blah.cfm?number=0312341234 is this possible ? I understand we would have to somehow work our the patterns for phone numbers, but I think we can do this
thanks in advance

Re: find phone number and create hyperlink from it

Posted: Wed Jul 09, 2008 2:04 pm
by mknoll1

Code: Select all

VERSION BUILD=5100314     
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://www.w3schools.com/html/html_tables.asp     
SIZE X=801 Y=602    
WAIT SECONDS=3
EXTRACT POS=4 TYPE=TXT ATTR=<TD>*   
WAIT SECONDS=3
URL GOTO=http://google.com/{{!EXTRACT}}
WAIT SECONDS=3
You just need to write the code to recognize phone numbers. For my money I would probably recommend using Java or another high level robust language to inspect an extract of the whole page and determine what is a phone number and then send that as a variable to Iopus for whatever you want.

Somethign like this:

Code: Select all

Public String InitiateIopus(somevariables){
run iopus macro
return ExtractedPage
}

public ArrayList FIndNumbers(String ExtractedPage){
Find numbers in the text
return ArrayList PhoneNumbers
}

public void runIopusWith Numbers(ArrayListPhoneNumbers){
for (number:PhoneNumbers){
doIopusStuff(number)
}
}