Save the cookie by simulating login, and then go to the background page to constantly crawl the order data on a website.
Now there are two problems.
Now it's time to complete this function:
Automatically capture order data from the start of an analog login
Automatically sends a message to the administrator when the cookie expires, reminding the administrator to sign in again.
So, how do I set the saved cookie expiration time when I log in? And how to set every fixed time to perform a fetch data operation?
Is there a way to do this in a local test because of the processing of this data?
Reply content:
Save the cookie by simulating login, and then go to the background page to constantly crawl the order data on a website.
Now there are two problems.
Now it's time to complete this function:
Automatically capture order data from the start of an analog login
Automatically sends a message to the administrator when the cookie expires, reminding the administrator to sign in again.
So, how do I set the saved cookie expiration time when I log in? And how to set every fixed time to perform a fetch data operation?
Is there a way to do this in a local test because of the processing of this data?
To perform a crawl at regular intervals, you can use the CLI mode timer task.
Cookie set expiration time I don't think it is necessary for you to re-impersonate the login if the interface fails.
1 The site's order data prohibit frequent inquiries
Curl supports proxy requests, and he detects whether frequent requests are detected by IP
2 The site cookie expires after 10 minutes and needs to be re-logged after it expires (the cookie contains the SessionID that the session ID will expire, not a cookie)
According to your scenario, there are 2 types of cookie failures:
----1 session duration scrambled over server configured session duration (typically 30 minutes by default)
----2 user exits, the server actively destroys the session SessionID
Since you are to grasp the data, then the account should be yours, then 2 of the possible basic can be ruled out, as for 1 if you use the Curl Proxy request Then there is no 1 problem, If you are using a timed request to keep the session SessionID (another program requests every 15 minutes to keep the session)