Code Monkey home page Code Monkey logo

Comments (11)

y9c avatar y9c commented on May 18, 2024 4

@kennethreitz
@alochym01 @devxpy

The error is triggered by Chromium. Because pyppeteer fetch a Chromium package without sandbox, render a page on linux machine will return such error.

[0304/140522.189436:FATAL:zygote_host_impl_linux.cc(124)] No usable sandbox!

Pass args=['--no-sandbox'] to Chromium can suppress error.

#93


Edit request-html.py and run this example.

https://github.com/yech1990/requests-html/blob/b1e353d1f19bccbde714b0c74338368615b4ca5a/requests_html.py#L467

from requests_html import HTMLSession
session = HTMLSession()

r = session.get('http://python-requests.org')
r.html.render()
months = r.html.search('Python 2 will retire in only {months} months!')['months']
print(months)

from requests-html.

devxpy avatar devxpy commented on May 18, 2024 2

python 3.6 doesn't seem to help.

>>> r.html.render()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vagrant/.pyenv/versions/hacker_tube/lib/python3.6/site-packages/requests_html.py", line 416, in render
    content, result = loop.run_until_complete(_async_render(url=self.url, script=script, sleep=sleep, wait=wait, content=self.html, reload=reload, scrolldown=scrolldown, timeout=timeout))
  File "/home/vagrant/.pyenv/versions/3.6.4/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
  File "/home/vagrant/.pyenv/versions/hacker_tube/lib/python3.6/site-packages/requests_html.py", line 373, in _async_render
    browser = pyppeteer.launch(headless=True)
  File "/home/vagrant/.pyenv/versions/hacker_tube/lib/python3.6/site-packages/pyppeteer/launcher.py", line 161, in launch
    return Launcher(options, **kwargs).launch()
  File "/home/vagrant/.pyenv/versions/hacker_tube/lib/python3.6/site-packages/pyppeteer/launcher.py", line 127, in launch
    raise BrowserError('Unexpectedly chrome process closed with '
pyppeteer.errors.BrowserError: Unexpectedly chrome process closed with return code: 127

from requests-html.

alimehran200 avatar alimehran200 commented on May 18, 2024 2

perfect solution https://blog.csdn.net/wgPython/article/details/102519342

from requests-html.

alochym01 avatar alochym01 commented on May 18, 2024 1

hi all

when i did deeper into pyppeteer, the pyppeteer is not stable right now, we should do some test on requests-html and wait for pyppeteer stabled enough :)

be careful when run in without sandbox and should test on Debian OS

https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

thank you for the worked around @yech1990

from requests-html.

nd7c avatar nd7c commented on May 18, 2024

Same, but 127 return code:

from requests_html import HTMLSession
session=HTMLSession()
r = session.get('http://python-requests.org')
r.html.render()
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    r.html.render()
  File "/usr/local/lib/python3.5/dist-packages/requests_html.py", line 282, in render
    content, result = loop.run_until_complete(_async_render(url=self.url, script=script, sleep=sleep, scrolldown=scrolldown))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
    return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/requests_html.py", line 250, in _async_render
    browser = pyppeteer.launch(headless=True)
  File "/usr/local/lib/python3.5/dist-packages/pyppeteer/launcher.py", line 103, in launch
    return Launcher(options, **kwargs).launch()
  File "/usr/local/lib/python3.5/dist-packages/pyppeteer/launcher.py", line 75, in launch
    ['Unexpectedly chrome process closed with return code: ', '{}'.format(self.proc.returncode)]))
pyppeteer.errors.BrowserError: Unexpectedly chrome process closed with return code: 127

(0.6.5 version)

from requests-html.

kennethreitz avatar kennethreitz commented on May 18, 2024

strange

from requests-html.

kennethreitz avatar kennethreitz commented on May 18, 2024

this looks like a pyppeteer issue, not a requests-html issue

from requests-html.

kennethreitz avatar kennethreitz commented on May 18, 2024

try python 3.6

from requests-html.

wenguonideshou avatar wenguonideshou commented on May 18, 2024

I get the 127 return code:
Python3.6 requests-html 0.7.2

[W:pyppeteer.chromium_downloader] chromium download done.
[W:pyppeteer.chromium_downloader] chromium extracted to: /root/.pyppeteer/local-chromium/533271
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/requests_html.py", line 398, in render
content, result = loop.run_until_complete(_async_render(url=self.url, script=script, sleep=sleep, content=self.html, reload=reload, scrolldown=scrolldown))
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/site-packages/requests_html.py", line 363, in _async_render
browser = pyppeteer.launch(headless=True)
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 146, in launch
return Launcher(options, **kwargs).launch()
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 111, in launch
raise BrowserError('Unexpectedly chrome process closed with '
pyppeteer.errors.BrowserError: Unexpectedly chrome process closed with return code: 127

from requests-html.

nd7c avatar nd7c commented on May 18, 2024

@wenguonideshou I think the author can skip this message and better way to create a new issue.

from requests-html.

devxpy avatar devxpy commented on May 18, 2024

@yech1990 Confirmed working +1

from requests-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.