Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion snapshot_selenium/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

from selenium import webdriver

from selenium.webdriver.chrome.service import Service # set chromedriver
from chromedriver_py import binary_path # add chromedriver


SNAPSHOT_JS = """
var ele = document.querySelector('div[_echarts_instance_]');
var mychart = echarts.getInstanceByDom(ele);
Expand Down Expand Up @@ -55,7 +59,10 @@ def make_snapshot(
def get_chrome_driver():
options = webdriver.ChromeOptions()
options.add_argument("headless")
return webdriver.Chrome(options=options)
return webdriver.Chrome(
options=options,
service=Service(binary_path) # bind chromedriver
)


def get_safari_driver():
Expand Down