Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnboundLocalError: local variable 'user' referenced before assignment #14

Open
nccdhelton opened this issue Jan 13, 2019 · 2 comments
Open

Comments

@nccdhelton
Copy link

Running LinkedInt on either macOS or Kali Linux, I encounter this error whenever I try to do a scrape.

Here is a transcript of the session (with company and person info redacted)

[*] Enter search Keywords (use quotes for more percise results)


[*] Enter filename for output (exclude file extension)
LinkedInt-Test

[*] Filter by Company? (Y/N): 
Y

[*] Specify a Company ID (Provide ID or leave blank to automate): 
<REDACTED>

[*] Enter e-mail domain suffix (eg. contoso.com): 
<REDACTED>.com

[*] Select a prefix for e-mail generation (auto,full,firstlast,firstmlast,flast,first.last,fmlast,lastfirst): 
auto 

[*] Automaticly using Hunter IO to determine best Prefix
[!] {first}
[+] Found first prefix

[!] Cannot load main LinkedIn page
<REDACTED>
[*] Obtained new session: <REDACTED>

[*] Using company ID: <REDACTED>
https://www.linkedin.com/voyager/api/search/cluster?count=40&guides=List(v->PEOPLE,facetCurrentCompany-><REDACTED>)&origin=OTHER&q=guided&start=0
[*] 122 Results Found
[*] Fetching 3 Pages

[*] Fetching page 0 with 40 results
[*] No picture found for <REDACTED>, ___
Traceback (most recent call last):
  File "LinkedInt.py", line 477, in <module>
    get_search()
  File "LinkedInt.py", line 273, in get_search
    email = '{}@{}'.format(user, suffix)
UnboundLocalError: local variable 'user' referenced before assignment
@Kaan191
Copy link

Kaan191 commented Jan 14, 2019 via email

@nccdhelton
Copy link
Author

Figured out what the problem is...there is no logic to handle a 'first' email format (first-name-only is used for the email address, eg. bob@contoso.com). I added the following if statement on line 272...

if prefix == 'first':
    user = '{}'.format(fname)

Now it works fine for my use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants