Scrape a public linked-in profile using scrapy

166 views
Skip to first unread message

Rock Slate

unread,
Jul 11, 2015, 6:25:20 AM7/11/15
to scrapy...@googlegroups.com
Hi,

I am trying to scrape a public linkedin profile using scrapy. I started of with scrapy shell linkedinprofile. When I try the response.body I get this message
Out[1]: '<html><head>\n<script type="text/javascript">\nwindow.onload = function() {\n  var newLocat
ion = "";\n  if (window.location.protocol == "http:") {\n    var cookies = document.cookie.split(";
");\n    for (var i = 0; i < cookies.length; ++i) {\n      if ((cookies[i].indexOf("sl=") == 0) && (
cookies[i].length > 3)) {\n        newLocation = "https:" + window.location.href.substring(window.lo
cation.protocol.length);\n      }\n    }\n  }\n\n  if (newLocation.length == 0) {\n    var domain =
location.host;\n    var newDomainIndex = 0;\n    if (domain.substr(0, 6) == "touch.") {\n      newDo
mainIndex = 6;\n    }\n    else if (domain.substr(0, 7) == "tablet.") {\n      newDomainIndex = 7;\n
    }\n    if (newDomainIndex) {\n      domain = domain.substr(newDomainIndex);\n    }\n    newLocat
ion = "https://" + domain +  "/uas/login?trk=sentinel_org_block&session_redirect=" + encodeURICompon
ent(window.location)\n  }\n  window.location.href = newLocation;\n}\n</script>\n</head></html>\n'

I dont need to authenticate to view public profile. What am I doing wrong?

Travis Leleu

unread,
Jul 11, 2015, 12:56:59 PM7/11/15
to scrapy-users

LinkedIn is sensitive to scraping. You need to set user agent headers and use a proxy.

--
You received this message because you are subscribed to the Google Groups "scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scrapy-users...@googlegroups.com.
To post to this group, send email to scrapy...@googlegroups.com.
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages