Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] screen scraping with firefox - best practices?
#12
With findrx, always check the return value, to know when it finds and when not. With flag 4 it returns 0 if 0 matches found.
Macro Macro2124
Code:
Copy      Help
;;grab source code - this part works

int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a.Find(w "DOCUMENT" "" "" 0x3010 2)
str html
a.WebPageProp(0 0 html)

;;findrx - find links matching the regex pattern and show it
ARRAY(str) l
int i
str pattern=
;(?<=<a\ class="comment-count"\ href=").*(?="\ title="Comments\ for:\ )

if(0=findrx(html pattern 0 4 l)) end "not found"

for i 0 l.len
,out l[0 i]


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)