Login Session avatar
Login Session
Try for free

No credit card required

View all Actors
Login Session

Login Session

pocesar/login-session
Try for free

No credit card required

Get localStorage, sessionStorage and cookies from logins for usage in other actors.

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode

Node.js

Python

curl

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Prepare the Actor input
7run_input = {
8    "userAgent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",
9    "maxRequestRetries": 0,
10    "sessionConfig": {
11        "storageName": "login-sessions",
12        "maxAgeSecs": 3600,
13        "maxUsageCount": 100,
14        "maxPoolSize": 100,
15    },
16    "steps": [{
17            "username": { "selector": "input#email" },
18            "password": { "selector": "input#pass" },
19            "submit": { "selector": "input[type=\"submit\"]" },
20            "failed": { "selector": "[role=\"alert\"]" },
21            "waitForMillis": 5000,
22        }],
23    "cookieDomains": [],
24    "gotoTimeout": 30,
25    "proxyConfiguration": { "useApifyProxy": True },
26    "extraUrlPatterns": [],
27}
28
29# Run the Actor and wait for it to finish
30run = client.actor("pocesar/login-session").call(run_input=run_input)
31
32# Fetch and print Actor results from the run's dataset (if there are any)
33for item in client.dataset(run["defaultDatasetId"]).iterate_items():
34    print(item)
Developer
Maintained by Community
Actor metrics
  • 10 monthly users
  • 36.4% runs succeeded
  • 0.0 days response time
  • Created in Feb 2020
  • Modified about 3 years ago
Categories