Comments (11)
@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.
Edit request-html.py
and run this example.
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.
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.
perfect solution https://blog.csdn.net/wgPython/article/details/102519342
from requests-html.
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.
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.
strange
from requests-html.
this looks like a pyppeteer issue, not a requests-html issue
from requests-html.
try python 3.6
from requests-html.
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.
@wenguonideshou I think the author can skip this message and better way to create a new issue.
from requests-html.
@yech1990 Confirmed working +1
from requests-html.
Related Issues (20)
- "Your browser is outdated" error HOT 3
- running render in Termux
- Type annotations
- Consider switching from lxml's clean_html for enhanced security (and possibly performance) HOT 1
- Get all html error
- hover on "read more"
- orange marker in the header
- playwright page.on("response", handler) HOT 1
- Not support get text in Element within other element'text of Element (innerText)
- find() got always None on JS rendered website
- How to select element in drop-down list
- PermissionError: [WinError 5] Access is denied - python - pytesseract.image_to_string
- LXML 5.2.0 breaks import HOT 2
- Websocket failing connection when rendering
- OSError: Chromium downloadable not found HOT 4
- after render without cookie
- pyppeteer is unmaintained HOT 1
- Basic doc example no longer works
- Future exception was never retrieved Error
- Blocking URLs when Traversing Links and Parsing HTML
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from requests-html.