0

Using the LinkedIn Scraper Gem and having some trouble with proxifying it. It works great on local and no problems at all, but in production, I keep getting redirected to the login page. Wanting to have it run through proxy, how do I do that?

When I make a regular HTTP request on my server:

Net::HTTP.get(URI.parse('http://www.linkedin.com/in/SOMETHING'))

I get

=> "<html><head>\n<script type=\"text/javascript\">\nwindow.onload = function() {\n  var domain = document.domain;\n  var newDomainIndex = 0;\n  if (domain.substr(0, 6) == \"touch.\") {\n    newDomainIndex = 6;\n  }\n  else if (domain.substr(0, 7) == \"tablet.\") {\n    newDomainIndex = 7;\n  }\n  if (newDomainIndex) {\n    domain = domain.substr(newDomainIndex);\n  }\n  window.location = \"https://\" + domain +  \"/uas/login?trk=sentinel_org_block&session_redirect=\" + encodeURIComponent(window.location);\n}\n</script>\n</head></html>\n" 

Thanks!

Mohamed El Mahallawy
  • 13,024
  • 13
  • 52
  • 84

1 Answers1

0

I also had a similar problem. As mention here, LinkedIn do not allow direct access. Most likely they have blocked your server's IP address. You will have to use their APIs.

Community
  • 1
  • 1
Ankush Shah
  • 938
  • 8
  • 13