browserbeam 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +29 -4
- data/lib/browserbeam/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f56eec67915879c1fb60e4c81cd34b4bd93d52cda25c5da6f72ad3def1f6a74
|
|
4
|
+
data.tar.gz: 58fbf4bab5ba5f29414cc4368310b2c120b2224a5455ea1946b8a86773aae7b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7654e9332dd6745df0fff89d113d8de9b6120b8d632e09eb9e114de6120569fae5e0bc2a96e721881c3b099bb33e250d24562e3fcf8576db3aaa4ac84bb0acaf
|
|
7
|
+
data.tar.gz: 1a3bdeb98537414f79d9d8cc5d1e00e488d834e8cbe66e0080116afb00ca3bfc74904c8b028fc6965dbc3422967e7554e7fee1bfd7f2e6194864ad82f23393f9
|
data/README.md
CHANGED
|
@@ -30,10 +30,17 @@ puts session.page.interactive_elements
|
|
|
30
30
|
# Interact with the page
|
|
31
31
|
session.click(ref: "e1")
|
|
32
32
|
|
|
33
|
-
# Extract
|
|
33
|
+
# Extract with CSS, AI, and JS selectors combined
|
|
34
34
|
result = session.extract(
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
products: [{
|
|
36
|
+
"_parent": ".product-card",
|
|
37
|
+
"_limit": 3,
|
|
38
|
+
"name": "h2 >> text", # CSS selector
|
|
39
|
+
"price": ".price >> text", # CSS selector
|
|
40
|
+
"url": "a >> href", # CSS attribute
|
|
41
|
+
"rating": "ai >> the star rating out of 5", # AI selector
|
|
42
|
+
"in_stock": "js >> el.querySelector('.stock')?.textContent.includes('In stock')", # JS
|
|
43
|
+
}]
|
|
37
44
|
)
|
|
38
45
|
puts result.extraction
|
|
39
46
|
|
|
@@ -57,15 +64,33 @@ client = Browserbeam::Client.new(
|
|
|
57
64
|
session = client.sessions.create(
|
|
58
65
|
url: "https://example.com",
|
|
59
66
|
viewport: { width: 1280, height: 720 },
|
|
67
|
+
user_agent: "Mozilla/5.0 ...", # omit for automatic rotation
|
|
60
68
|
locale: "en-US",
|
|
61
69
|
timezone: "America/New_York",
|
|
62
|
-
proxy: "http://user:pass@proxy:8080",
|
|
63
70
|
block_resources: ["image", "font"],
|
|
64
71
|
auto_dismiss_blockers: true,
|
|
65
72
|
timeout: 300,
|
|
66
73
|
)
|
|
67
74
|
```
|
|
68
75
|
|
|
76
|
+
### Proxies
|
|
77
|
+
|
|
78
|
+
All sessions use a datacenter proxy by default (country auto-detected from the URL's TLD). No configuration needed. To customize:
|
|
79
|
+
|
|
80
|
+
```ruby
|
|
81
|
+
# Use a residential proxy for a specific country
|
|
82
|
+
session = client.sessions.create(
|
|
83
|
+
url: "https://example.com",
|
|
84
|
+
proxy: { kind: "residential", country: "us" },
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Or bring your own proxy (overrides managed proxy)
|
|
88
|
+
session = client.sessions.create(
|
|
89
|
+
url: "https://example.com",
|
|
90
|
+
proxy: "http://user:pass@proxy:8080",
|
|
91
|
+
)
|
|
92
|
+
```
|
|
93
|
+
|
|
69
94
|
## Available Methods
|
|
70
95
|
|
|
71
96
|
| Method | Description |
|
data/lib/browserbeam/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: browserbeam
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Browserbeam
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|