Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

requests lib throwing Invalid value NaN (not a number) Error #155

Open
Cherchercher opened this issue Feb 14, 2022 · 1 comment
Open

requests lib throwing Invalid value NaN (not a number) Error #155

Cherchercher opened this issue Feb 14, 2022 · 1 comment

Comments

@Cherchercher
Copy link

Looks to me the HTML content is not returned hence the len is null...?

Value error processing url https://www.instagram.com/p/COSfR9mh4WN/ Invalid value NaN (not a number)

Traceback (most recent call last):
post.scrape(headers=headers)
File "/usr/local/lib/python3.9/site-packages/instascrape/scrapers/post.py", line 73, in scrape
return_instance = super().scrape(
File "/usr/local/lib/python3.9/site-packages/instascrape/core/_static_scraper.py", line 144, in scrape
return_data = self._get_json_from_source(self.source, headers=headers, session=session)
File "/usr/local/lib/python3.9/site-packages/instascrape/core/_static_scraper.py", line 244, in _get_json_from_source
html = self._html_from_url(url=url, headers=headers, session=session)
File "/usr/local/lib/python3.9/site-packages/instascrape/core/_static_scraper.py", line 285, in _html_from_url
response = session.get(url, headers=headers)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1371, in getresponse
response.begin()
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 319, in begin
version, status, reason = self._read_status()
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 280, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)

@kareemrasheed89
Copy link

I do we solve using this library

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

No branches or pull requests

2 participants