Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add chromedriver_py #7

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
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