Skip to content

Commit

Permalink
added commercial search limit bit (#23)
Browse files Browse the repository at this point in the history
* added commercial search limit bit

* bumped version

Co-authored-by: Chris Moberly <[email protected]>
  • Loading branch information
initstring and Chris Moberly authored Sep 28, 2020
1 parent 7a002d8 commit c893279
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This is a pure web-scraper, no API key required. You use your valid LinkedIn use

Use an account with a lot of connections, otherwise you'll get crappy results. Adding a couple connections at the target company should help - this tool will work up to third degree connections. Note that [LinkedIn will cap search results](https://www.linkedin.com/help/linkedin/answer/129/what-you-get-when-you-search-on-linkedin?lang=en) to 1000 employees max. You can use the features '--geoblast' or '--keywords' to bypass this limit. Look at help below for more details.

**WARNING**: LinkedIn has recently (Sept 2020) been hitting li2u users with the monthly commercial search limit. It's a bit mysterious as to when/why this happens. When you hit the limit, you won't be able to search again until the 1st of the month. If you know of a workaround, please let me know.

Here's what you get:
- first.last.txt: Usernames like Joe.Schmoe
- flast.txt: Usernames like JSchmoe
Expand Down
9 changes: 8 additions & 1 deletion linkedin2username.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

########## BEGIN GLOBAL DECLARATIONS ##########

CURRENT_REL = '0.17'
CURRENT_REL = '0.18'
BANNER = r"""
.__ .__________
Expand Down Expand Up @@ -521,6 +521,13 @@ def scrape_info(session, company_id, staff_count, args):
first_name = re.findall(r'"firstName":"(.*?)"', result)
last_name = re.findall(r'"lastName":"(.*?)"', result)

# Commercial Search Limit might be triggered
if "UPSELL_LIMIT" in result:
sys.stdout.write('\n')
print(PC.warn_box + "You've hit the commercial search limit!"
" Try again on the 1st of the month. Sorry. :(")
break

# If the list of names is empty for a page, we assume that
# there are no more search results. Either you got them all or
# you are not connected enough to get them all.
Expand Down

0 comments on commit c893279

Please sign in to comment.