← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #259773]: Receive data from GET request

 

Question #259773 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/259773

Description changed to:
Hello.
Is it possible for Sikuli  to do the following:

1. Sikuli script makes a request to page: http://example.com/get.php
2. get.php sends us back GET request: 

vr=50-100

the GET request result is always different

3. When sikuli takes each variable from the received request and uses it, substituting the values. When I use it in the following code:
...
        if now.hour >= 0 and now.hour < 1:   # 00:00 - 01:00
            # send request to http://example.com/get.php and receive a reply
            # If from http://example.com/get.php no response is received - to try to get it again
            mytime = random.randint (50, 100) # received from the GET request - vr
        if now.hour >= 1 and now.hour < 2:   # 01:00 - 02:00
            # send request to http://example.com/get.php and receive a reply
            # If from http://example.com/get.php no response is received - to try to get it again
            mytime = random.randint (100, 150) # received from the GET request - vr
        if now.hour >= 2 and now.hour < 3:   # 02:00 - 03:00
            # send request to http://example.com/get.php and receive a reply
            # If from http://example.com/get.php no response is received - to try to get it again
            mytime = random.randint (200, 300) # received from the GET request - vr

        wait (mytime)
...

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.