How to get company logo from Linkedin API?

后端 未结 3 2246
难免孤独
难免孤独 2021-02-20 00:51

I made a mock company profile on Linkedin & have uploaded two images (see screenshot at bottom of question) and I\'m trying to get the second image (large).

I can g

3条回答
  •  -上瘾入骨i
    2021-02-20 01:10

    You cannot do it, becuase the second image depends on how that company designed its page on linkedin.

    A company with out second large image,

    https://www.linkedin.com/company/ztrdg

    A company with second large image as it is not a logo,

    https://www.linkedin.com/company/ibm

    So that image (large one) is not managed by linkedin, of course you cannot get it from linkedin's api.

    The only thing you can do is that resize the logo with a good image library. I suggest the imgscalr in java.

    If you want to get big image when it exists, you can use the company url, and get whole html document, then find the url which is in top-image class. And a piece of code:

    Document  docu = Jsoup.connect(companyUrl).
                timeout(TIMEOUT).
                userAgent(CRAWLER_NAME).
                get();
    Elements elements = document.getElementsByClassName("top-image");
    

提交回复
热议问题