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

render traceback on raspberry pi

Open tgraf2 opened this issue 3 years ago • 3 comments

Attempting to render a simple html file with javascript on raspberry pi results in OSError: [Errno 8] Exec format error: '/home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome'

python3 Python 3.8.2 (default, Mar 9 2021, 11:34:25) from requests_html import HTML file = "scrape/temp_file2.html" with open(file) as html_file: source = html_file.read() html = HTML(html=source) html.render()

Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python3.8/site-packages/requests_html.py", line 586, in render self.browser = self.session.browser # Automatically create a event loop and browser File "/home/pi/.local/lib/python3.8/site-packages/requests_html.py", line 730, in browser self._browser = self.loop.run_until_complete(super().browser) File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/pi/.local/lib/python3.8/site-packages/requests_html.py", line 714, in browser self._browser = await pyppeteer.launch(ignoreHTTPSErrors=not(self.verify), headless=True, args=self.__browser_args) File "/home/pi/.local/lib/python3.8/site-packages/pyppeteer/launcher.py", line 306, in launch return await Launcher(options, **kwargs).launch() File "/home/pi/.local/lib/python3.8/site-packages/pyppeteer/launcher.py", line 147, in launch self.proc = subprocess.Popen( # type: ignore File "/usr/local/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: '/home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome'

The html file contains the following:

print(source)

Test - A Sample Website

Test Website


Article 1 Headline

This is a summary of article 1


Article 2 Headline

This is a summary of article 2


tgraf2 avatar Mar 10 '21 15:03 tgraf2

Anyone find a way to use this on raspberry, basically the chrome binary downloaded from pyppeteer is x86-64 rather than ARM binary

[W:pyppeteer.chromium_downloader] Starting Chromium download. Download may take a few minutes.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 109M/109M [00:10<00:00, 10.7Mb/s]
[W:pyppeteer.chromium_downloader] Chromium download done.

[W:pyppeteer.chromium_downloader] chromium extracted to: /home/pi/.local/share/pyppeteer/local-chromium/588429
...
$ ls -la /home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome
-rwxr-xr-x 1 pi pi 214121928 Sep 11 20:35 /home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome
$ file /home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome
/home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped

quoing avatar Sep 11 '21 18:09 quoing

Actually it is similar to issue https://github.com/puppeteer/puppeteer/issues/550 , some workarounds in comments

quoing avatar Sep 11 '21 18:09 quoing

And pyppeteer PR https://github.com/pyppeteer/pyppeteer/pull/302

quoing avatar Sep 11 '21 19:09 quoing