I'm starting a small project to scrape linkedin data using selenium, the first thing I'm noticing is that the login page is not working the same way when I use selenium.
When I load the page manually on the brower I get this response:

But when I do the same using selenium the response is different, even when the url is the same:

I a manually click on "iniciar sesion" I get redirected to the lonin page:

But the url is the same, how can I directly load proper page or trick the site so It does not detect than I'm using selenium?
This is the code I currently have:
from selenium import webdriver
import datetime
import time
import argparse
import os
#Define the argument parser to read in the URL
parser = argparse.ArgumentParser()
parser.add_argument('-url', '--url', help='URL to the online repository of images')
args = vars(parser.parse_args())
url = args['url']
url = "https://www.linkedin.com/m/login/"
# Initialize the Chrome webdriver and open the URL
driver = webdriver.Firefox()
driver.get(url)
EDIT:
I found that this link loads the right page directly:
https://www.linkedin.com/uas/login?session_redirect=%2Fvoyager%2FloginRedirect%2Ehtml&fromSignIn=true&trk=uno-reg-join-sign-in
Exactly! You should probably use the API to access the data sets you are after.
https://pypi.org/project/python-linkedin-v2/
See the link below for some additional ideas of how to move this forward.
How to use linkedin API with python
If you can't use the API, you probably shouldn't be doing this, at least not on LinkedIn. Good luck!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With