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

UnicodeEncodeError, cannot auth #21

Open
EricWebsmith opened this issue Jan 2, 2024 · 0 comments
Open

UnicodeEncodeError, cannot auth #21

EricWebsmith opened this issue Jan 2, 2024 · 0 comments

Comments

@EricWebsmith
Copy link

UnicodeEncodeError

Thanks

❯ ./scrap https://leetcode.com/problems/convert-an-array-into-a-2d-array-with-conditions/description/\?envType\=daily-question\&envId\=2024-01-02
2024-01-02 08:53:10,842 Starting new HTTPS connection (1): leetcode.com:443
Traceback (most recent call last):
File "/home/eric/leetcode_py/scraping/scraper.py", line 32, in
scraper_result = ProblemScraper()(title_slug)
File "/home/eric/leetcode_py/scraping/scraper_problem.py", line 18, in init
self.api_instance = self.get_api_instance(leetcode_session, csrf_token)
File "/home/eric/leetcode_py/scraping/scraper_problem.py", line 21, in get_api_instance
csrf_token = leetcode.auth.get_csrf_cookie(leetcode_session)
File "/home/eric/.local/lib/python3.10/site-packages/leetcode/auth.py", line 5, in get_csrf_cookie
response = requests.get(
File "/home/eric/.local/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/eric/.local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/eric/.local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/eric/.local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/eric/.local/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/home/eric/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/home/eric/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/home/eric/.local/lib/python3.10/site-packages/urllib3/connection.py", line 394, in request
self.putheader(header, value)
File "/home/eric/.local/lib/python3.10/site-packages/urllib3/connection.py", line 308, in putheader
super().putheader(header, *values)
File "/usr/lib/python3.10/http/client.py", line 1256, in putheader
values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 164: ordinal not in range(256)

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

1 participant