File tree Expand file tree Collapse file tree
crates/reach-cli/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,10 +47,11 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
4747 && npm install -g computer-use-mcp \
4848 && rm -rf /var/lib/apt/lists/*
4949
50- # Layer 4: Playwright + Scrapling
50+ # Layer 4: Playwright + Scrapling + websockify
5151RUN pip install --break-system-packages \
5252 playwright \
5353 "scrapling[fetchers]" \
54+ websockify \
5455 && playwright install chromium \
5556 && scrapling install \
5657 || true
@@ -65,9 +66,11 @@ RUN git_url="https://github.com/novnc/noVNC.git" && \
6566# Layer 6: reach-supervisor binary
6667COPY --from=builder /build/target/release/reach-supervisor /usr/local/bin/reach-supervisor
6768
68- # Layer 7: User + permissions
69+ # Layer 7: User + permissions + X11 socket dir
6970RUN useradd -m -s /bin/bash sandbox \
70- && echo "sandbox ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
71+ && echo "sandbox ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
72+ && mkdir -p /tmp/.X11-unix \
73+ && chmod 1777 /tmp/.X11-unix
7174
7275# Chrome policies — disable auto-updates, first-run
7376COPY config/chrome-policies.json /etc/opt/chrome/policies/managed/reach.json
Original file line number Diff line number Diff line change @@ -133,11 +133,11 @@ async fn dispatch_tool(
133133 let url = args. get ( "url" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "" ) ;
134134 let selector = args. get ( "selector" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "body" ) ;
135135 let stealth = args. get ( "stealth" ) . and_then ( |v| v. as_bool ( ) ) . unwrap_or ( true ) ;
136- let fetcher = if stealth { "StealthFetcher " } else { "Scraper " } ;
136+ let fetcher = if stealth { "StealthyFetcher " } else { "Fetcher " } ;
137137 let script = format ! (
138- "from scrapling import {fetcher}; r = {fetcher}().fetch ('{url}'); \
138+ "from scrapling import {fetcher}; r = {fetcher}().get ('{url}'); \
139139 elems = r.css('{selector}'); \
140- import json; print(json.dumps([{{'content': e.text() , 'tag': e.tag}} for e in elems]))"
140+ import json; print(json.dumps([{{'content': e.text, 'tag': e.tag}} for e in elems]))"
141141 ) ;
142142 exec_python ( docker, target, & script) . await
143143 }
Original file line number Diff line number Diff line change @@ -172,14 +172,14 @@ async fn dispatch(
172172 let url = args. get ( "url" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "" ) ;
173173 let sel = args. get ( "selector" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "body" ) ;
174174 let stealth = args. get ( "stealth" ) . and_then ( |v| v. as_bool ( ) ) . unwrap_or ( true ) ;
175- let f = if stealth { "StealthFetcher " } else { "Scraper " } ;
175+ let f = if stealth { "StealthyFetcher " } else { "Fetcher " } ;
176176 py (
177177 state,
178178 target,
179179 & format ! (
180- "from scrapling import {f}; r = {f}().fetch ('{url}'); \
180+ "from scrapling import {f}; r = {f}().get ('{url}'); \
181181 elems = r.css('{sel}'); \
182- import json; print(json.dumps([{{'content': e.text() , 'tag': e.tag}} for e in elems]))"
182+ import json; print(json.dumps([{{'content': e.text, 'tag': e.tag}} for e in elems]))"
183183 ) ,
184184 )
185185 . await
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ fn scrapling_can_scrape_page() {
393393 assert ! ( wait_for_health( 30 ) ) ;
394394
395395 let out = exec_in_container (
396- "python3 -c \" from scrapling import Scraper ; r = Scraper ().fetch ('https://example.com'); print(r.css('h1').text() )\" "
396+ "python3 -c \" from scrapling import Fetcher ; r = Fetcher ().get ('https://example.com'); print(r.css('h1')[0] .text)\" "
397397 ) ;
398398 let stdout = String :: from_utf8_lossy ( & out. stdout ) ;
399399 assert ! (
You can’t perform that action at this time.
0 commit comments