requests-html icon indicating copy to clipboard operation
requests-html copied to clipboard

RE: Javascript rendering error (pyppeteer.errors.PageError: net::ERR_CERT_SYMANTEC_LEGACY) #174

Open yoonthegoon opened this issue 3 years ago • 1 comments

Same traceback message as #174

Traceback (most recent call last):
  File "C:\Users\user\PycharmProjects\slowpoke\sharpv.py", line 28, in <module>
    main(
  File "C:\Users\user\PycharmProjects\slowpoke\sharpv.py", line 20, in main
    r.html.render()
  File "C:\Users\user\PycharmProjects\slowpoke\venv\lib\site-packages\requests_html.py", line 598, in render
    content, result, page = self.session.loop.run_until_complete(self._async_render(url=self.url, script=script, sleep=sleep, wait=wait, content=self.html, reload=reload, scrolldown=scrolldown, timeout=timeout, keep_page=keep_page))
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "C:\Users\user\PycharmProjects\slowpoke\venv\lib\site-packages\requests_html.py", line 512, in _async_render
    await page.goto(url, options={'timeout': int(timeout * 1000)})
  File "C:\Users\user\PycharmProjects\slowpoke\venv\lib\site-packages\pyppeteer\page.py", line 831, in goto
    raise PageError(result)
pyppeteer.errors.PageError: net::ERR_CERT_AUTHORITY_INVALID at https://192.168.134.131/

As suggested in oldani's comment, I do have verify=False in my request.

import requests_html
s = requests_html.HTMLSession()
r = s.post(url, data, verify=False)
r.html.render()

It appears at least at least one other user was facing the issue after it being closed.

yoonthegoon avatar Mar 16 '22 14:03 yoonthegoon

Google Chrome no longer considers SSL certificates issued by Symantec before 1st June 2016 as valid, and pyppeteer uses Chromium under the hood. Perhaps it's worth using Let's Encrypt instead, if that's possible?

Also, an FYI: using verify=false will help you circumvent SSL certificate errors, but it can expose your application to security risks such as man-in-the-middle attacks. Consequently, it is probably worth using with caution...

aroundwithalex avatar May 01 '22 13:05 aroundwithalex