Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ RUN locale-gen en_US.UTF-8
# Fingerprint Configuration
#===========================
RUN apt-get update
RUN apt install -y fonts-liberation fonts-noto-color-emoji libvulkan1 libnss3 libatk-bridge2.0-0 libcups2 libxcomposite1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2
RUN apt install -y fonts-noto-color-emoji libvulkan1 libnss3 libatk-bridge2.0-0 libcups2 libxcomposite1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2
RUN apt install -y fonts-freefont-ttf fonts-dejavu-core fonts-ubuntu fonts-roboto fonts-droid-fallback

#======================
# Install Common Fonts
#======================
RUN apt-get update
RUN apt-get install -y \
fonts-clear-sans \
fonts-liberation2 \
fonts-font-awesome \
fonts-terminus \
Expand Down Expand Up @@ -125,7 +126,16 @@ COPY MANIFEST.in /SeleniumBase/MANIFEST.in
COPY pytest.ini /SeleniumBase/pytest.ini
COPY setup.cfg /SeleniumBase/setup.cfg
COPY virtualenv_install.sh /SeleniumBase/virtualenv_install.sh
COPY mcp_servers /SeleniumBase/mcp_servers/
COPY README.md /SeleniumBase/README.md
COPY pyproject.toml /SeleniumBase/pyproject.toml
COPY LICENSE /SeleniumBase/LICENSE
RUN find . -name '*.pyc' -delete
RUN echo '#!/bin/sh' > /usr/local/bin/pip \
&& echo 'exec python3.13 -m pip "$@"' >> /usr/local/bin/pip \
&& chmod +x /usr/local/bin/pip \
&& pip --version
ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN pip install --upgrade pip setuptools wheel
RUN cd /SeleniumBase && ls && pip install -r requirements.txt --upgrade
RUN cd /SeleniumBase && pip install .
Expand Down
2 changes: 1 addition & 1 deletion examples/cdp_mode/raw_cdp_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
sb.assert_element("span#pip-command")
sb.assert_text("Download files", "div#files h2.page-title")
sb.assert_text("Download files", "a#files-tab")
pkg_header = sb.get_text("h1.package-header__name").strip()
pkg_header = sb.get_text('h1[class*="header__name"]').strip()
pkg_name = pkg_header.replace(" ", "-")
whl_file = pkg_name + "-py3-none-any.whl"
tar_gz_file = pkg_name + ".tar.gz"
Expand Down
1 change: 0 additions & 1 deletion examples/cdp_mode/raw_indeed_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
for i, item in enumerate(items):
print(f"* <====== {i + 1} ======>")
print(item.text)
item.scroll_into_view()
print(f"*** {len(items)} total items found!")
4 changes: 2 additions & 2 deletions examples/cdp_mode/raw_mouser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
with SB(uc=True, test=True, guest=True) as sb:
sb.activate_cdp_mode()
sb.goto("https://www.mouser.com/")
search_box = 'input[name="keyword"]'
search_box = 'input[data-testid="global-search"]'
sb.sleep(1.6)
sb.solve_captcha()
sb.sleep(1.8)
sb.wait_for_element(search_box)
sb.sleep(1.2)
sb.press_keys(search_box, "FLUKE-TC01B 25HZ")
sb.sleep(1.2)
sb.click('button[type="submit"]')
sb.click('a[id*="search-option"]')
sb.sleep(3.2)
sb.wait_for_element("span#spnDescription")
soup = sb.get_beautiful_soup()
Expand Down
1 change: 0 additions & 1 deletion examples/cdp_mode/raw_softpedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@
for link in links:
sb.goto(link)
sb.remove_elements("div.ad")
sb.sleep(2)
8 changes: 3 additions & 5 deletions examples/cdp_mode/raw_wsform.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""CDP Mode for bypassing bot-detection & CAPTCHAs.
Note: sb.uc_gui_click_captcha() requires PyAutoGUI,
which is installed automatically if not already."""
"""CDP Mode for bypassing bot-detection & CAPTCHAs."""
from seleniumbase import SB

with SB(uc=True, test=True, locale="en", incognito=True) as sb:
sb.activate_cdp_mode()
sb.goto("https://wsform.com/demo/")
sb.sleep(2)
sb.scroll_into_view("div.grid")
sb.uc_gui_click_captcha() # PyAutoGUI mouse click
sb.scroll_into_view('form[method="POST"]')
sb.solve_captcha()
sb.sleep(2)
2 changes: 1 addition & 1 deletion mcp_servers/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "seleniumbase-mcp"
version = "1.3.5dev0"
version = "1.3.6dev0"
description = "MCP server exposing SeleniumBase CDP Mode as tools for MCP clients."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
Loading