hustcc / PyG2Plot

🎨 Python3 binding for `@AntV/G2Plot` Plotting Library .
MIT License
1.07k stars 116 forks source link

selenium.common.exceptions.JavascriptException: Message: javascript error: echarts is not defined #33

Open Frankcsc opened 2 years ago

Frankcsc commented 2 years ago

使用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 <module>
    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 <unknown>
#1 0x557451856778 <unknown>
#2 0x557451859617 <unknown>
#3 0x5574518594c4 <unknown>
#4 0x55745185a07d <unknown>
#5 0x5574518bf853 <unknown>
#6 0x5574518aba02 <unknown>
#7 0x5574518bec74 <unknown>
#8 0x5574518ab8f3 <unknown>
#9 0x5574518810d8 <unknown>
#10 0x557451882205 <unknown>
#11 0x557451a97e3d <unknown>
#12 0x557451a9adb6 <unknown>
#13 0x557451a8113e <unknown>
#14 0x557451a9b9b5 <unknown>
#15 0x557451a75970 <unknown>
#16 0x557451ab8228 <unknown>
#17 0x557451ab83bf <unknown>
#18 0x557451ad2abe <unknown>
#19 0x7f7f5964f609 <unknown>
seetimee commented 1 year ago

同问