selenium.common.exceptions.JavascriptException: Message: javascript error: echarts is not defined
- Lingua principale
- Python
- Stelle
- 1.1k
- Fork
- 115
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
使用from snapshot_selenium import snapshot将得到的html转为图片,报错,
使用方法为pyecharts.render.make_snapshot(snapshot_selenium.snapshot, 'xxx.html', 'xxx.png')
```
Traceback (most recent call last):
File "/home/tests/test_1.py", line 20, in
make_snapshot(snapshot, '/home/plot.html', "bar0.png")
File "/usr/local/lib/python3.8/dist-packages/pyecharts/render/snapshot.py", line 32, in make_snapshot
content = engine.make_snapshot(
File "/usr/local/lib/python3.8/dist-packages/snapshot_selenium/snapshot.py", line 52, in make_snapshot
return driver.execute_script(snapshot_js)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 491, in execute_script
return self.execute(command, {
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 428, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: javascript error: echarts is not defined
(Session info: headless chrome=104.0.5112.101)
Stacktrace:
#0 0x557451a50403
#1 0x557451856778
#2 0x557451859617
#3 0x5574518594c4
#4 0x55745185a07d
#5 0x5574518bf853
#6 0x5574518aba02
#7 0x5574518bec74
#8 0x5574518ab8f3
#9 0x5574518810d8
#10 0x557451882205
#11 0x557451a97e3d
#12 0x557451a9adb6
#13 0x557451a8113e
#14 0x557451a9b9b5
#15 0x557451a75970
#16 0x557451ab8228
#17 0x557451ab83bf
#18 0x557451ad2abe
#19 0x7f7f5964f609
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start with pyecharts/render/snapshot.py and snapshot_selenium/snapshot.py, then reproduce the reported make_snapshot call using the provided HTML and headless Chrome setup. Trace why the page does not define echarts; done means the same snapshot_selenium workflow renders the HTML to PNG without JavascriptException.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100