1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "userAgent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",
10 "maxRequestRetries": 0,
11 "sessionConfig": {
12 "storageName": "login-sessions",
13 "maxAgeSecs": 3600,
14 "maxUsageCount": 100,
15 "maxPoolSize": 100,
16 },
17 "steps": [{
18 "username": { "selector": "input#email" },
19 "password": { "selector": "input#pass" },
20 "submit": { "selector": "input[type=\"submit\"]" },
21 "failed": { "selector": "[role=\"alert\"]" },
22 "waitForMillis": 5000,
23 }],
24 "cookieDomains": [],
25 "gotoTimeout": 30,
26 "proxyConfiguration": { "useApifyProxy": True },
27 "extraUrlPatterns": [],
28}
29
30
31run = client.actor("pocesar/login-session").call(run_input=run_input)
32
33
34print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
35for item in client.dataset(run["defaultDatasetId"]).iterate_items():
36 print(item)
37
38