Skip to content

Commit

Permalink
Merge pull request #7 from tatsuhiro-t/update-chrome-driver
Browse files Browse the repository at this point in the history
update chrome driver to 107.0.5304.18
  • Loading branch information
marten-seemann authored Oct 3, 2022
2 parents a00bc87 + 5b80e91 commit 46ab409
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update && \

RUN pip3 install selenium

ENV CHROMEDRIVER_VERSION="98.0.4758.80"
ENV CHROMEDRIVER_VERSION="107.0.5304.18"
RUN wget -q "https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" && \
unzip chromedriver_linux64.zip && \
mv chromedriver /usr/bin && \
Expand Down
12 changes: 10 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

DOWNLOADS = "/downloads/"

Expand Down Expand Up @@ -51,9 +53,15 @@ def get_args():
},
)

driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver", options=options)

service = Service(
executable_path="/usr/bin/chromedriver"
)


driver = webdriver.Chrome(service=service, options=options)
driver.get("file:///save.html")
for el in driver.find_elements_by_tag_name("a"):
for el in driver.find_elements(By.TAG_NAME, "a"):
print("Downloading link " + el.get_attribute("href"))
el.click()

Expand Down

0 comments on commit 46ab409

Please sign in to comment.