How to avoid “HTTP/1.1 999 Request denied” response from LinkedIn?

前端 未结 4 628
梦毁少年i
梦毁少年i 2020-12-10 09:43

I\'m making request to LinkedIn page and receiving \"HTTP/1.1 999 Request denied\" response. I use AWS/EC-2 and get this response. On localhost everything works fine.

<
相关标签:
4条回答
  • 2020-12-10 09:57

    Note that the error 999 don't exist in W3C Hypertext Transfer Protocol - HTTP/1.1, probably this error is customized (sounds like a joke)

    LinkedIn don't allow direct access, the probable reason of them blocking any "url" from others webservers access should be to:

    1. Prevent unauthorized copying of information
    2. Prevent invasions
    3. Prevent abuse of requests.
    4. Force use API

    Some IP addresses of servers are blocked, as the "IP" from "domestic ISP" are not blocked and that when you access the LinkedIn with web-browser you use the IP of your internet provider.

    The only way to access the data is to use their APIs. See:

    • Accessing LinkedIn public pages using Python
    • Heroku requests return 999

    Note: The search engines like Google and Bing probably have their IPs in a "whitelist".

    0 讨论(0)
  • 2020-12-10 09:57

    I ran into this while doing local web development and using the LinkedIn badge feature (profile.js). I was only getting the 999 Request denied in Chrome, so I just cleared my browser cache and localStorage and it started to work again.

    UPDATE - Clearing cache was just a coincidence and the issue came back. LinkedIn is having issues with their badge functionality.

    I submitted a help thread to their forums. https://www.linkedin.com/help/linkedin/forum/question/714971

    0 讨论(0)
  • 2020-12-10 10:03

    LinkedIn is not supporting the default encoding 'identity' , so if you set the header

    'Accept-Encoding': 'gzip, deflate'

    you should get the response , but you would have to decompress it.

    0 讨论(0)
  • 2020-12-10 10:20
    <?php
    header("Content-Type: text/plain");
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://www.linkedin.com/company/technistone-a-s-");
    
    $header = array();
    $header[] = "Host: www.linkedin.com";
    $header[] = "User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0";
    $header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
    $header[] = "Accept-Language: en-US,en;q=0.5";
    $header[] = "Accept-Encoding: gzip, deflate, br";
    $header[] = "Connection: keep-alive";
    $header[] = "Upgrade-Insecure-Requests: 1";
    
    curl_setopt($ch,CURLOPT_ENCODING , "gzip");
    curl_setopt($ch, CURLOPT_HTTPHEADER , $header);
    $my_var = curl_exec($ch);
    
    echo $my_var;
    
    0 讨论(0)
提交回复
热议问题