简体   繁体   中英

Proxify LinkedIn Scraper gem

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM