Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please Help, Excel extraction and paste to Website - Loop
#12
This is definitely a lot more stable.

Function AnyWho_Lookup2
Code:
Copy      Help
function ARRAY(str)&ReturnInformation [str'First] [str'Last] [str'State] [str'City] [str'Zip]

str AnyWhoURL.format("http://whitepages.anywho.com/results.php?&qc=%s&qf=%s&qn=%s&qs=%s&qz=%s&qi=0&qk=100" City First Last State Zip)
HtmlDoc d.InitFromWeb(AnyWhoURL)

ARRAY(str) a Entry Information
d.GetTable(12 a 0 1)
int j
for j 0 a.len
,if(matchw(a[j] "<TABLE class=resultTable*"))
,,goto Populate
,if(matchw(a[j] "*<SPAN class=singleName*"))
,,goto Populate
,,;Populate
,,int flag=1
,,d.InitFromText(a[j])
,,d.GetTable(0 Entry)
,,tok(Entry[0] Information 4 "[]" 16)
,,str& entry=ReturnInformation[];entry.from(Information[0])
,,&entry=ReturnInformation[];entry.from(Information[1])
,,&entry=ReturnInformation[];entry.from(Information[2])
,,&entry=ReturnInformation[];entry.from(Information[3])
,,&entry=ReturnInformation[];entry.from("----------")

if flag=1;ret
_s=Information;_i=val(_s);if _i=0;out "No Matches";ret

ret

Is there anything else you could recommend to do to make this code better? It's looking pretty short now Smile
Thanks,
jimmy Vig


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)