Skip to content

Commit

Permalink
pre-install drivers and use headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Sep 29, 2024
1 parent 5dd2cfd commit cfe7a3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions novel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY . /app
RUN pip install --no-cache-dir -r /app/requirements.txt

RUN seleniumbase get chromedriver --path
RUN pyarmor gen --output /app /app/main.py

HEALTHCHECK --start-period=10s --interval=60s --timeout=3s CMD curl -f http://localhost:80/health || exit 1
Expand Down
2 changes: 1 addition & 1 deletion novel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def load_cache():

def get_url_html(url, proxy=None):
try:
with SB(uc=True, proxy=proxy) as sb:
with SB(uc=True, proxy=proxy, headless2=True) as sb:
sb.uc_open_with_reconnect(url, 5)
sb.uc_gui_click_captcha()
return sb.get_page_source()
Expand Down

0 comments on commit cfe7a3e

Please sign in to comment.