Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quickest way to download an element from web page
#1
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
#2
Download whole page and extract the element using regular expression.
Code:
Copy      Help
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
#3
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
#4
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)