Posts: 21
Threads: 8
Joined: Apr 2007
what would be the short way to get piece of text from internet w/o starting up ie browser.
for example the time string from
http://cgi1.ebay.com/aw-cgi/eBayISAPI.dll?TimeShow
i love how IntGetFile works and hope that just an element of the page may be fetched in same manner.
thanks a lot,
-vlad
Posts: 11,922
Threads: 138
Joined: Dec 2002
Download whole page and extract the element using regular expression.
str s ss
IntGetFile "http://cgi1.ebay.com/aw-cgi/eBayISAPI.dll?TimeShow" s
;out s
if(findrx(s "<p>The official eBay Time is now:</p><p><b>(.+?)</b>" 0 1 ss 1)<0) end "eBay time page structure changed, please edit the regular expression"
out ss
Posts: 21
Threads: 8
Joined: Apr 2007
It's so nice! and you of course. This is perfect example on how to use qm for automating routine procedures. it takes half of second from start to finish and minimum of system resources. wondering if there is possibility to identify input elements while the page is in string variable, set the text in there, and post page back?
Thanks again,
-vlad
Posts: 11,922
Threads: 138
Joined: Dec 2002
To post web form data, use PostFormData function of Http class. When you use it, you usually know elements and hardcode them into the macro. Why would you need to identify elements at run time? It should be possible using regular expressions, but not so easy.