Naive question about interacting with web pages

SparkOut SparkOutYNY at gmail.com
Wed Aug 26 11:25:53 EDT 2009




Sarah Reichelt-2 wrote:
> 
> 
> This may be possible depending on how the site handles requests.
> Some sites have the input data become part of the URL for the results
> page.
> 
> e.g. if I want to do a Google search for chocolate, I can go to Google
> and type in chocolate, or I could go directly to
> <http://www.google.com/search?q=chocolate>
> where you can see that "chocolate" is already part of the URL.
> 
> In Rev, I could use:
>   get URL "http://www.google.com/search?q=chocolate"
> and I would have the text of the returned web page.
> 
> Once you have the text of the page, then you can manipulate it using
> the standard text chunking, filtering & searching tools.
> If you are looking for an image, then you could try:
>   get offset(" , tWebPage)

If you then end up with something like:
<img src= 
> you can pull out the "images/pic12345.jpg" part, add the root address
> of the web page, to get
>   http://www.website.com/images/pic12345.jpg
> and then set the filename of an image in your stack to this address.
> 
> So firstly, go to the web page you are trying to access and do a
> search manually.
> Check the URL of the results page and see if it contains the data you
> entered.
> If it does, then use Rev to construct that URL and get the text of the web
> page.
> Then you can examine that text and work out how to extract what you
> need from it.
> 
> Hope this helps,
> Sarah
> 
Also if you download the addon LiveHTTPHeaders for Firefox, you can set that
in the sidebar and watch the submissions and responses from the server in
real time. You can then check what headers you may need to set in the
request, depending on cookies/POST or GET method, etc.
In essence though, that action of "get url.." or "post theURLencodedData to
url..." mimic exactly what a regular gui based browser does, requesting
pages from a server according to whatever submission has been determined. If
you need to be logged in as an authenticated user, then you will have to
examine the headers to see what process of session cookie exchange there is,
but although that adds an extra step, it can still be done without too much
drama. 
-- 
View this message in context: http://www.nabble.com/Naive-question-about-interacting-with-web-pages-tp25136809p25151424.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list