how to pass login data via the fabric -u linkedin.com | fabric -summarize #1185
Replies: 1 comment
-
The problem is that LinkedIn (like most major websites) uses login-based authentication with session cookies, CSRF tokens, and probably other security measures. You can automate the login process using curl, store the session cookies, and then pass those cookies to fabric -u when scraping the page. Steps: Use the saved session cookies to request the protected page. Pass the retrieved page contents to fabric -u.
curl -c cookies.txt -X POST "https://www.linkedin.com/uas/login-submit" -X POST --> Sends a POST request to submit login credentials. -d -->Sends email and password in the request body. -H "User-Agent: ..." --> Some websites block curl unless you mimic a real browser. Note: LinkedIn likely uses anti-bot protections (CSRF tokens, captchas, etc.), so this approach might not work directly. You'd then need to extract and pass a CSRF token in the request.
curl -b cookies.txt -L "https://www.linkedin.com/specific_page" -o page.html -L --> Follows redirects. -o page.html --> Saves the page content to a file.
cat page.html | fabric -u #this won't work, you need to add xargs, the -u flag does not accept STDIN, so... Potential Issues CSRF Token Requirement: LinkedIn probably requires a CSRF token in addition to the username and password. You would need to scrape it from the login page first. Legal & Ethical Considerations: Scraping a site behind a login might violate LinkedIn’s Terms of Service. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Specifically I want to get a summary of a linked in page
https://www.linkedin.com/search/results/all/?keywords=ILTM&origin=GLOBAL_SEARCH_HEADER&sid=o~k
I passed
fabric -u https://www.linkedin.com/search/results/all/?keywords=ILTM"&"origin=GLOBAL_SEARCH_HEADER"&"sid=o~k | fabric -p summarize
Note the "&"
but linkedin coughed out that I need to be logged in (which I am!) but LI needs more from me/fabric

Can someone share their login/password workaround for LinkedIn (and other sites?)
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions