@olib-ai/owl-browser-sdk 2.0.5 → 2.0.6

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.
Files changed (111) hide show
  1. package/README.md +107 -0
  2. package/dist/extraction/content-cleaner.d.ts +40 -0
  3. package/dist/extraction/content-cleaner.d.ts.map +1 -0
  4. package/dist/extraction/content-cleaner.js +393 -0
  5. package/dist/extraction/content-cleaner.js.map +1 -0
  6. package/dist/extraction/extractor.d.ts +139 -0
  7. package/dist/extraction/extractor.d.ts.map +1 -0
  8. package/dist/extraction/extractor.js +212 -0
  9. package/dist/extraction/extractor.js.map +1 -0
  10. package/dist/extraction/html-processor.d.ts +75 -0
  11. package/dist/extraction/html-processor.d.ts.map +1 -0
  12. package/dist/extraction/html-processor.js +192 -0
  13. package/dist/extraction/html-processor.js.map +1 -0
  14. package/dist/extraction/index.d.ts +14 -0
  15. package/dist/extraction/index.d.ts.map +1 -0
  16. package/dist/extraction/index.js +19 -0
  17. package/dist/extraction/index.js.map +1 -0
  18. package/dist/extraction/list-extractor.d.ts +24 -0
  19. package/dist/extraction/list-extractor.d.ts.map +1 -0
  20. package/dist/extraction/list-extractor.js +303 -0
  21. package/dist/extraction/list-extractor.js.map +1 -0
  22. package/dist/extraction/meta-extractor.d.ts +40 -0
  23. package/dist/extraction/meta-extractor.d.ts.map +1 -0
  24. package/dist/extraction/meta-extractor.js +216 -0
  25. package/dist/extraction/meta-extractor.js.map +1 -0
  26. package/dist/extraction/pagination.d.ts +29 -0
  27. package/dist/extraction/pagination.d.ts.map +1 -0
  28. package/dist/extraction/pagination.js +323 -0
  29. package/dist/extraction/pagination.js.map +1 -0
  30. package/dist/extraction/pattern-detector.d.ts +16 -0
  31. package/dist/extraction/pattern-detector.d.ts.map +1 -0
  32. package/dist/extraction/pattern-detector.js +390 -0
  33. package/dist/extraction/pattern-detector.js.map +1 -0
  34. package/dist/extraction/scrape-session.d.ts +23 -0
  35. package/dist/extraction/scrape-session.d.ts.map +1 -0
  36. package/dist/extraction/scrape-session.js +192 -0
  37. package/dist/extraction/scrape-session.js.map +1 -0
  38. package/dist/extraction/selector-engine.d.ts +23 -0
  39. package/dist/extraction/selector-engine.d.ts.map +1 -0
  40. package/dist/extraction/selector-engine.js +127 -0
  41. package/dist/extraction/selector-engine.js.map +1 -0
  42. package/dist/extraction/table-extractor.d.ts +29 -0
  43. package/dist/extraction/table-extractor.d.ts.map +1 -0
  44. package/dist/extraction/table-extractor.js +282 -0
  45. package/dist/extraction/table-extractor.js.map +1 -0
  46. package/dist/extraction/transforms.d.ts +47 -0
  47. package/dist/extraction/transforms.d.ts.map +1 -0
  48. package/dist/extraction/transforms.js +277 -0
  49. package/dist/extraction/transforms.js.map +1 -0
  50. package/dist/extraction/types.d.ts +199 -0
  51. package/dist/extraction/types.d.ts.map +1 -0
  52. package/dist/extraction/types.js +5 -0
  53. package/dist/extraction/types.js.map +1 -0
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +2 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/playwright/browser-type.d.ts +101 -0
  59. package/dist/playwright/browser-type.d.ts.map +1 -0
  60. package/dist/playwright/browser-type.js +134 -0
  61. package/dist/playwright/browser-type.js.map +1 -0
  62. package/dist/playwright/browser.d.ts +98 -0
  63. package/dist/playwright/browser.d.ts.map +1 -0
  64. package/dist/playwright/browser.js +229 -0
  65. package/dist/playwright/browser.js.map +1 -0
  66. package/dist/playwright/context.d.ts +211 -0
  67. package/dist/playwright/context.d.ts.map +1 -0
  68. package/dist/playwright/context.js +466 -0
  69. package/dist/playwright/context.js.map +1 -0
  70. package/dist/playwright/extractor.d.ts +108 -0
  71. package/dist/playwright/extractor.d.ts.map +1 -0
  72. package/dist/playwright/extractor.js +404 -0
  73. package/dist/playwright/extractor.js.map +1 -0
  74. package/dist/playwright/frame.d.ts +147 -0
  75. package/dist/playwright/frame.d.ts.map +1 -0
  76. package/dist/playwright/frame.js +492 -0
  77. package/dist/playwright/frame.js.map +1 -0
  78. package/dist/playwright/index.d.ts +163 -0
  79. package/dist/playwright/index.d.ts.map +1 -0
  80. package/dist/playwright/index.js +313 -0
  81. package/dist/playwright/index.js.map +1 -0
  82. package/dist/playwright/keyboard.d.ts +74 -0
  83. package/dist/playwright/keyboard.d.ts.map +1 -0
  84. package/dist/playwright/keyboard.js +187 -0
  85. package/dist/playwright/keyboard.js.map +1 -0
  86. package/dist/playwright/locator.d.ts +237 -0
  87. package/dist/playwright/locator.d.ts.map +1 -0
  88. package/dist/playwright/locator.js +646 -0
  89. package/dist/playwright/locator.js.map +1 -0
  90. package/dist/playwright/mouse.d.ts +82 -0
  91. package/dist/playwright/mouse.d.ts.map +1 -0
  92. package/dist/playwright/mouse.js +137 -0
  93. package/dist/playwright/mouse.js.map +1 -0
  94. package/dist/playwright/page-helpers.d.ts +261 -0
  95. package/dist/playwright/page-helpers.d.ts.map +1 -0
  96. package/dist/playwright/page-helpers.js +423 -0
  97. package/dist/playwright/page-helpers.js.map +1 -0
  98. package/dist/playwright/page.d.ts +566 -0
  99. package/dist/playwright/page.d.ts.map +1 -0
  100. package/dist/playwright/page.js +1476 -0
  101. package/dist/playwright/page.js.map +1 -0
  102. package/dist/playwright/response.d.ts +100 -0
  103. package/dist/playwright/response.d.ts.map +1 -0
  104. package/dist/playwright/response.js +194 -0
  105. package/dist/playwright/response.js.map +1 -0
  106. package/dist/playwright/types.d.ts +354 -0
  107. package/dist/playwright/types.d.ts.map +1 -0
  108. package/dist/playwright/types.js +8 -0
  109. package/dist/playwright/types.js.map +1 -0
  110. package/openapi.json +327 -35
  111. package/package.json +10 -1
package/openapi.json CHANGED
@@ -3,11 +3,11 @@
3
3
  "info": {
4
4
  "title": "Owl Browser API",
5
5
  "description": "REST API for browser automation with anti-detection capabilities",
6
- "version": "1.0.8"
6
+ "version": "1.0.9"
7
7
  },
8
8
  "servers": [
9
9
  {
10
- "url": "http://localhost",
10
+ "url": "http://127.0.0.1:8080",
11
11
  "description": "Current server"
12
12
  }
13
13
  ],
@@ -639,10 +639,54 @@
639
639
  }
640
640
  }
641
641
  },
642
+ "/api/execute/browser_set_content": {
643
+ "post": {
644
+ "summary": "Browser Set Content",
645
+ "description": "Set the page's HTML content directly. Replaces the current page content with the provided HTML. The page URL will be 'about:blank'. Useful for rendering HTML templates, testing, or injecting content without making a network request.",
646
+ "tags": [
647
+ "General"
648
+ ],
649
+ "requestBody": {
650
+ "required": true,
651
+ "content": {
652
+ "application/json": {
653
+ "schema": {
654
+ "type": "object",
655
+ "properties": {
656
+ "context_id": {
657
+ "type": "string",
658
+ "description": "The unique identifier of the browser context (e.g., 'ctx_000001')"
659
+ },
660
+ "html": {
661
+ "type": "string",
662
+ "description": "The HTML content to set as the page body. Can be a full HTML document or a fragment. The page URL will be set to 'about:blank'"
663
+ }
664
+ },
665
+ "required": [
666
+ "context_id",
667
+ "html"
668
+ ]
669
+ }
670
+ }
671
+ }
672
+ },
673
+ "responses": {
674
+ "200": {
675
+ "description": "Successful response"
676
+ },
677
+ "400": {
678
+ "description": "Bad request"
679
+ },
680
+ "401": {
681
+ "description": "Unauthorized"
682
+ }
683
+ }
684
+ }
685
+ },
642
686
  "/api/execute/browser_click": {
643
687
  "post": {
644
688
  "summary": "Browser Click",
645
- "description": "Click on an element using CSS selector, XY coordinates, or natural language description. Supports semantic element finding using AI - describe what you want to click (e.g., 'login button', 'search icon') and the system will locate the right element. Simulates a real mouse click with proper event dispatch.",
689
+ "description": "Click on an element using CSS selector, XY coordinates, or natural language description. Supports semantic element finding using AI - describe what you want to click (e.g., 'login button', 'search icon') and the system will locate the right element. Simulates a real mouse click with proper event dispatch. Optionally hold the mouse button for press-and-hold interactions using hold_ms.",
646
690
  "tags": [
647
691
  "General"
648
692
  ],
@@ -660,6 +704,14 @@
660
704
  "selector": {
661
705
  "type": "string",
662
706
  "description": "Target element to click. Accepts: CSS selector (e.g., '#submit-btn', '.nav-link'), XY coordinates as 'Xx Y' (e.g., '100x200'), or natural language description (e.g., 'login button', 'search icon'). Semantic descriptions use AI to find the element"
707
+ },
708
+ "hold_ms": {
709
+ "type": "string",
710
+ "description": "Duration in milliseconds to hold the mouse button down before releasing. Use for press-and-hold interactions (e.g., long press menus, drag initiation). Default: 0 (immediate click)"
711
+ },
712
+ "index": {
713
+ "type": "string",
714
+ "description": "When multiple elements match the selector, click the Nth element (0-based). Uses querySelectorAll()[index] instead of querySelector(). Default: -1 (first match)"
663
715
  }
664
716
  },
665
717
  "required": [
@@ -686,7 +738,7 @@
686
738
  "/api/execute/browser_type": {
687
739
  "post": {
688
740
  "summary": "Browser Type",
689
- "description": "Type text into an input field with human-like keystroke simulation. Target the field using CSS selector, coordinates, or natural language (e.g., 'email field'). Note: Does NOT clear existing content - use browser_clear_input first if you need to replace text rather than append.",
741
+ "description": "Type text into an input field with human-like keystroke simulation. Target the field using CSS selector, coordinates, or natural language (e.g., 'email field'). When selector is omitted, types into the currently focused element. Note: Does NOT clear existing content - use browser_clear_input first if you need to replace text rather than append.",
690
742
  "tags": [
691
743
  "General"
692
744
  ],
@@ -703,16 +755,19 @@
703
755
  },
704
756
  "selector": {
705
757
  "type": "string",
706
- "description": "Target input field. Accepts: CSS selector (e.g., '#email', 'input[name=\"username\"]'), XY coordinates (e.g., '100x200'), or natural language description (e.g., 'email field', 'search box')"
758
+ "description": "Target input field. Accepts: CSS selector (e.g., '#email', 'input[name=\"username\"]'), XY coordinates (e.g., '100x200'), or natural language description (e.g., 'email field', 'search box'). When omitted, types into the currently focused element (document.activeElement)"
707
759
  },
708
760
  "text": {
709
761
  "type": "string",
710
762
  "description": "The text to type into the input field. Simulates real keystrokes with human-like timing. Existing content is NOT cleared - use browser_clear_input first if needed"
763
+ },
764
+ "index": {
765
+ "type": "string",
766
+ "description": "When multiple elements match the selector, target the Nth element (0-based). Uses querySelectorAll()[index] instead of querySelector(). Default: -1 (first match)"
711
767
  }
712
768
  },
713
769
  "required": [
714
770
  "context_id",
715
- "selector",
716
771
  "text"
717
772
  ]
718
773
  }
@@ -784,7 +839,7 @@
784
839
  "/api/execute/browser_press_key": {
785
840
  "post": {
786
841
  "summary": "Browser Press Key",
787
- "description": "Press a special keyboard key like Enter, Tab, Escape, or arrow keys. The key is sent to the currently focused element. Common uses: Enter to submit forms, Tab to move between fields, Escape to close modals, Arrow keys for navigation in menus or sliders.",
842
+ "description": "Press a keyboard key. Supports special keys (Enter, Tab, Escape, arrow keys, etc.) and single characters (a-z, A-Z, 0-9). The key is sent to the currently focused element. Common uses: Enter to submit forms, Tab to move between fields, Escape to close modals, Arrow keys for navigation in menus or sliders, or single characters for keyboard shortcuts.",
788
843
  "tags": [
789
844
  "General"
790
845
  ],
@@ -801,30 +856,7 @@
801
856
  },
802
857
  "key": {
803
858
  "type": "string",
804
- "description": "Special key to press. Common uses: 'Enter' to submit forms, 'Tab' to move focus, 'Escape' to close modals, 'ArrowDown/Up' for navigation. The key is sent to the currently focused element",
805
- "enum": [
806
- "Enter",
807
- "Return",
808
- "Tab",
809
- "Escape",
810
- "Esc",
811
- "Backspace",
812
- "Delete",
813
- "Del",
814
- "ArrowUp",
815
- "Up",
816
- "ArrowDown",
817
- "Down",
818
- "ArrowLeft",
819
- "Left",
820
- "ArrowRight",
821
- "Right",
822
- "Space",
823
- "Home",
824
- "End",
825
- "PageUp",
826
- "PageDown"
827
- ]
859
+ "description": "Key to press. Supports special keys: 'Enter', 'Tab', 'Escape', 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Space', 'Home', 'End', 'PageUp', 'PageDown'. Also supports single characters: 'a'-'z', 'A'-'Z', '0'-'9'. The key is sent to the currently focused element"
828
860
  }
829
861
  },
830
862
  "required": [
@@ -1087,6 +1119,10 @@
1087
1119
  "selector": {
1088
1120
  "type": "string",
1089
1121
  "description": "CSS selector, position coordinates (e.g., '100x200'), or natural language description of the element to hover over"
1122
+ },
1123
+ "index": {
1124
+ "type": "string",
1125
+ "description": "When multiple elements match the selector, target the Nth element (0-based). Default: -1 (first match)"
1090
1126
  }
1091
1127
  },
1092
1128
  "required": [
@@ -1131,6 +1167,10 @@
1131
1167
  "selector": {
1132
1168
  "type": "string",
1133
1169
  "description": "CSS selector, position coordinates (e.g., '100x200'), or natural language description of the element to double-click"
1170
+ },
1171
+ "index": {
1172
+ "type": "string",
1173
+ "description": "When multiple elements match the selector, target the Nth element (0-based). Default: -1 (first match)"
1134
1174
  }
1135
1175
  },
1136
1176
  "required": [
@@ -1175,6 +1215,10 @@
1175
1215
  "selector": {
1176
1216
  "type": "string",
1177
1217
  "description": "CSS selector, position coordinates (e.g., '100x200'), or natural language description of the element to right-click"
1218
+ },
1219
+ "index": {
1220
+ "type": "string",
1221
+ "description": "When multiple elements match the selector, target the Nth element (0-based). Default: -1 (first match)"
1178
1222
  }
1179
1223
  },
1180
1224
  "required": [
@@ -1219,6 +1263,10 @@
1219
1263
  "selector": {
1220
1264
  "type": "string",
1221
1265
  "description": "CSS selector or natural language description of the input element to clear"
1266
+ },
1267
+ "index": {
1268
+ "type": "string",
1269
+ "description": "When multiple elements match the selector, target the Nth element (0-based). Default: -1 (first match)"
1222
1270
  }
1223
1271
  },
1224
1272
  "required": [
@@ -1263,6 +1311,10 @@
1263
1311
  "selector": {
1264
1312
  "type": "string",
1265
1313
  "description": "CSS selector or natural language description of the element to focus"
1314
+ },
1315
+ "index": {
1316
+ "type": "string",
1317
+ "description": "When multiple elements match the selector, target the Nth element (0-based). Default: -1 (first match)"
1266
1318
  }
1267
1319
  },
1268
1320
  "required": [
@@ -1488,6 +1540,10 @@
1488
1540
  "selector": {
1489
1541
  "type": "string",
1490
1542
  "description": "CSS selector or natural language description of the element to check visibility for"
1543
+ },
1544
+ "index": {
1545
+ "type": "string",
1546
+ "description": "When multiple elements match the selector, check the Nth element (0-based). Default: -1 (first match)"
1491
1547
  }
1492
1548
  },
1493
1549
  "required": [
@@ -1532,6 +1588,10 @@
1532
1588
  "selector": {
1533
1589
  "type": "string",
1534
1590
  "description": "CSS selector or natural language description of the element to check enabled state for"
1591
+ },
1592
+ "index": {
1593
+ "type": "string",
1594
+ "description": "When multiple elements match the selector, check the Nth element (0-based). Default: -1 (first match)"
1535
1595
  }
1536
1596
  },
1537
1597
  "required": [
@@ -1576,6 +1636,10 @@
1576
1636
  "selector": {
1577
1637
  "type": "string",
1578
1638
  "description": "CSS selector or natural language description of the checkbox or radio button to check"
1639
+ },
1640
+ "index": {
1641
+ "type": "string",
1642
+ "description": "When multiple elements match the selector, check the Nth element (0-based). Default: -1 (first match)"
1579
1643
  }
1580
1644
  },
1581
1645
  "required": [
@@ -1599,6 +1663,151 @@
1599
1663
  }
1600
1664
  }
1601
1665
  },
1666
+ "/api/execute/browser_is_editable": {
1667
+ "post": {
1668
+ "summary": "Browser Is Editable",
1669
+ "description": "Check if an element is editable (not disabled AND not readOnly). Returns 'editable' if the element can accept user input, 'not_editable' if it is disabled or read-only. More comprehensive than browser_is_enabled which only checks the disabled attribute.",
1670
+ "tags": [
1671
+ "General"
1672
+ ],
1673
+ "requestBody": {
1674
+ "required": true,
1675
+ "content": {
1676
+ "application/json": {
1677
+ "schema": {
1678
+ "type": "object",
1679
+ "properties": {
1680
+ "context_id": {
1681
+ "type": "string",
1682
+ "description": "The unique identifier of the browser context (e.g., 'ctx_000001')"
1683
+ },
1684
+ "selector": {
1685
+ "type": "string",
1686
+ "description": "CSS selector or natural language description of the element to check editability for"
1687
+ },
1688
+ "index": {
1689
+ "type": "string",
1690
+ "description": "When multiple elements match the selector, check the Nth element (0-based). Default: -1 (first match)"
1691
+ }
1692
+ },
1693
+ "required": [
1694
+ "context_id",
1695
+ "selector"
1696
+ ]
1697
+ }
1698
+ }
1699
+ }
1700
+ },
1701
+ "responses": {
1702
+ "200": {
1703
+ "description": "Successful response"
1704
+ },
1705
+ "400": {
1706
+ "description": "Bad request"
1707
+ },
1708
+ "401": {
1709
+ "description": "Unauthorized"
1710
+ }
1711
+ }
1712
+ }
1713
+ },
1714
+ "/api/execute/browser_count_elements": {
1715
+ "post": {
1716
+ "summary": "Browser Count Elements",
1717
+ "description": "Count the number of elements matching a CSS selector. Returns the count as an integer. Useful for checking how many items exist (e.g., list items, search results, table rows) without extracting full element data.",
1718
+ "tags": [
1719
+ "General"
1720
+ ],
1721
+ "requestBody": {
1722
+ "required": true,
1723
+ "content": {
1724
+ "application/json": {
1725
+ "schema": {
1726
+ "type": "object",
1727
+ "properties": {
1728
+ "context_id": {
1729
+ "type": "string",
1730
+ "description": "The unique identifier of the browser context (e.g., 'ctx_000001')"
1731
+ },
1732
+ "selector": {
1733
+ "type": "string",
1734
+ "description": "CSS selector to count matching elements (e.g., 'li.item', 'input[type=\"text\"]', 'table tr')"
1735
+ }
1736
+ },
1737
+ "required": [
1738
+ "context_id",
1739
+ "selector"
1740
+ ]
1741
+ }
1742
+ }
1743
+ }
1744
+ },
1745
+ "responses": {
1746
+ "200": {
1747
+ "description": "Successful response"
1748
+ },
1749
+ "400": {
1750
+ "description": "Bad request"
1751
+ },
1752
+ "401": {
1753
+ "description": "Unauthorized"
1754
+ }
1755
+ }
1756
+ }
1757
+ },
1758
+ "/api/execute/browser_dispatch_event": {
1759
+ "post": {
1760
+ "summary": "Browser Dispatch Event",
1761
+ "description": "Dispatch a DOM event on an element. Programmatically triggers events like 'input', 'change', 'focus', 'blur', 'submit', etc. Useful for triggering event handlers after programmatic value changes, or for simulating user interactions that don't involve mouse/keyboard input.",
1762
+ "tags": [
1763
+ "General"
1764
+ ],
1765
+ "requestBody": {
1766
+ "required": true,
1767
+ "content": {
1768
+ "application/json": {
1769
+ "schema": {
1770
+ "type": "object",
1771
+ "properties": {
1772
+ "context_id": {
1773
+ "type": "string",
1774
+ "description": "The unique identifier of the browser context (e.g., 'ctx_000001')"
1775
+ },
1776
+ "selector": {
1777
+ "type": "string",
1778
+ "description": "CSS selector or natural language description of the element to dispatch the event on"
1779
+ },
1780
+ "event_type": {
1781
+ "type": "string",
1782
+ "description": "The DOM event type to dispatch (e.g., 'click', 'input', 'change', 'focus', 'blur', 'submit', 'mouseenter', 'mouseleave'). Any valid DOM event name is accepted"
1783
+ },
1784
+ "bubbles": {
1785
+ "type": "boolean",
1786
+ "description": "Whether the event should bubble up through the DOM tree. Default: true"
1787
+ }
1788
+ },
1789
+ "required": [
1790
+ "context_id",
1791
+ "selector",
1792
+ "event_type"
1793
+ ]
1794
+ }
1795
+ }
1796
+ }
1797
+ },
1798
+ "responses": {
1799
+ "200": {
1800
+ "description": "Successful response"
1801
+ },
1802
+ "400": {
1803
+ "description": "Bad request"
1804
+ },
1805
+ "401": {
1806
+ "description": "Unauthorized"
1807
+ }
1808
+ }
1809
+ }
1810
+ },
1602
1811
  "/api/execute/browser_get_attribute": {
1603
1812
  "post": {
1604
1813
  "summary": "Browser Get Attribute",
@@ -1624,6 +1833,10 @@
1624
1833
  "attribute": {
1625
1834
  "type": "string",
1626
1835
  "description": "The attribute name to retrieve (e.g., 'href', 'src', 'value', 'data-id', 'class')"
1836
+ },
1837
+ "index": {
1838
+ "type": "string",
1839
+ "description": "When multiple elements match the selector, get attribute from the Nth element (0-based). Default: -1 (first match)"
1627
1840
  }
1628
1841
  },
1629
1842
  "required": [
@@ -1669,6 +1882,10 @@
1669
1882
  "selector": {
1670
1883
  "type": "string",
1671
1884
  "description": "CSS selector or natural language description of the element to get position and size for"
1885
+ },
1886
+ "index": {
1887
+ "type": "string",
1888
+ "description": "When multiple elements match the selector, get bounding box of the Nth element (0-based). Default: -1 (first match)"
1672
1889
  }
1673
1890
  },
1674
1891
  "required": [
@@ -1990,7 +2207,7 @@
1990
2207
  "/api/execute/browser_extract_text": {
1991
2208
  "post": {
1992
2209
  "summary": "Browser Extract Text",
1993
- "description": "Extract visible text content from the page or a specific element. Returns plain text stripped of HTML tags. Optionally target a specific element using CSS selector or natural language description. Optionally apply a regex pattern to filter/extract specific content from the text. Useful for reading page content, extracting article text, getting form values, or extracting specific data like numbers, emails, or prices.",
2210
+ "description": "Extract visible text content from the page or a specific element. Returns plain text stripped of HTML tags. Optionally target a specific element using CSS selector or natural language description. When the selector matches multiple elements, returns a JSON array of text strings. Optionally apply a regex pattern to filter/extract specific content from the text (applied per-element when multiple matches). Useful for reading page content, extracting article text, getting form values, or extracting specific data like numbers, emails, or prices.",
1994
2211
  "tags": [
1995
2212
  "General"
1996
2213
  ],
@@ -2007,7 +2224,7 @@
2007
2224
  },
2008
2225
  "selector": {
2009
2226
  "type": "string",
2010
- "description": "Optional CSS selector or natural language description to extract text from a specific element. If omitted, extracts all visible text from the entire page. Examples: '#main-content', 'article', 'the product description'"
2227
+ "description": "Optional CSS selector or natural language description to extract text from a specific element. If omitted, extracts all visible text from the entire page. When the selector matches multiple elements, returns a JSON array of text strings (one per element). Examples: '#main-content', '.product-name', 'article'"
2011
2228
  },
2012
2229
  "regex": {
2013
2230
  "type": "string",
@@ -2016,6 +2233,10 @@
2016
2233
  "regex_group": {
2017
2234
  "type": "string",
2018
2235
  "description": "Which capture group to return from the regex match. 0 returns the full match (default), 1 returns the first capture group, 2 returns the second, etc. Example: with regex 'FP ID:\\\\s*(\\\\S+)' and regex_group=1, only the ID value is returned."
2236
+ },
2237
+ "index": {
2238
+ "type": "string",
2239
+ "description": "When multiple elements match the selector, extract text from the Nth element (0-based) instead of returning all. Default: not set (returns all matches as array). Set to 0 for first, 1 for second, -1 for last."
2019
2240
  }
2020
2241
  },
2021
2242
  "required": [
@@ -2123,6 +2344,10 @@
2123
2344
  "background_color": {
2124
2345
  "type": "string",
2125
2346
  "description": "CSS color for the highlight background (use alpha for transparency). Default: 'rgba(255, 0, 0, 0.2)'. Examples: 'rgba(0, 255, 0, 0.3)', 'transparent'"
2347
+ },
2348
+ "index": {
2349
+ "type": "string",
2350
+ "description": "When multiple elements match the selector, highlight the Nth element (0-based). Default: -1 (first match)"
2126
2351
  }
2127
2352
  },
2128
2353
  "required": [
@@ -2204,7 +2429,7 @@
2204
2429
  "/api/execute/browser_get_html": {
2205
2430
  "post": {
2206
2431
  "summary": "Browser Get Html",
2207
- "description": "Extract the page's HTML with configurable cleaning levels. 'minimal' preserves most structure, 'basic' removes scripts and styles, 'aggressive' strips to essential content. Useful for page analysis, content extraction, and feeding HTML to other processing tools.",
2432
+ "description": "Extract HTML content with configurable cleaning levels. Optionally target a specific element using a CSS selector to get its innerHTML instead of the full page. When the selector matches multiple elements, returns a JSON array of HTML strings. 'minimal' preserves most structure, 'basic' removes scripts and styles, 'aggressive' strips to essential content. Useful for page analysis, content extraction, and feeding HTML to other processing tools.",
2208
2433
  "tags": [
2209
2434
  "General"
2210
2435
  ],
@@ -2219,6 +2444,10 @@
2219
2444
  "type": "string",
2220
2445
  "description": "The unique identifier of the browser context (e.g., 'ctx_000001')"
2221
2446
  },
2447
+ "selector": {
2448
+ "type": "string",
2449
+ "description": "Optional CSS selector to get innerHTML of a specific element (e.g., '#content', '.article-body'). When the selector matches multiple elements, returns a JSON array of HTML strings (one per element). When omitted, returns the full page HTML"
2450
+ },
2222
2451
  "clean_level": {
2223
2452
  "type": "string",
2224
2453
  "description": "Level of HTML cleaning to apply. 'minimal': preserves most structure, 'basic': removes scripts/styles (default), 'aggressive': strips to essential content only. Choose based on how much structure you need",
@@ -2501,7 +2730,7 @@
2501
2730
  "/api/execute/browser_extract_json": {
2502
2731
  "post": {
2503
2732
  "summary": "Browser Extract Json",
2504
- "description": "Extract structured data from the page using predefined templates or auto-detection. Templates available for Google Search results, Wikipedia articles, Amazon products, GitHub repos, and more. Returns consistently structured JSON regardless of page layout changes.",
2733
+ "description": "Extract structured data from the page as JSON. For known sites (Google, Amazon, Wikipedia, etc.) uses predefined templates. For unknown sites, uses smart DOM analysis to detect repeating items (products, posts, search results) and extract fields (title, link, image, price, rating, date, description). Use 'selector' to scope extraction to a specific container. Returns page type, items array, structured LD+JSON data, and meta tags.",
2505
2734
  "tags": [
2506
2735
  "General"
2507
2736
  ],
@@ -2519,6 +2748,10 @@
2519
2748
  "template": {
2520
2749
  "type": "string",
2521
2750
  "description": "Extraction template name for known site types. Available: 'google_search', 'wikipedia', 'amazon_product', 'github_repo', 'twitter_feed', 'reddit_thread'. Leave empty for auto-detection based on URL"
2751
+ },
2752
+ "selector": {
2753
+ "type": "string",
2754
+ "description": "CSS selector to scope extraction to a specific container (e.g., 'div.product-grid', '#results'). When set, only elements within this container are analyzed for repeating patterns"
2522
2755
  }
2523
2756
  },
2524
2757
  "required": [
@@ -3119,6 +3352,10 @@
3119
3352
  "selector": {
3120
3353
  "type": "string",
3121
3354
  "description": "CSS selector or natural language description of the element to scroll into view. Examples: '#footer', '.product-reviews', 'the comments section'"
3355
+ },
3356
+ "index": {
3357
+ "type": "string",
3358
+ "description": "When multiple elements match the selector, scroll to the Nth element (0-based). Default: -1 (first match)"
3122
3359
  }
3123
3360
  },
3124
3361
  "required": [
@@ -3245,6 +3482,10 @@
3245
3482
  "timeout": {
3246
3483
  "type": "string",
3247
3484
  "description": "Maximum time to wait in milliseconds. Returns error if element doesn't appear within this time. Default: 5000 (5 seconds)"
3485
+ },
3486
+ "index": {
3487
+ "type": "string",
3488
+ "description": "When multiple elements match the selector, wait for the Nth element (0-based). Default: -1 (first match)"
3248
3489
  }
3249
3490
  },
3250
3491
  "required": [
@@ -6798,6 +7039,57 @@
6798
7039
  }
6799
7040
  }
6800
7041
  },
7042
+ "/api/execute/browser_get_page_map": {
7043
+ "post": {
7044
+ "summary": "Browser Get Page Map",
7045
+ "description": "Get a compact structured map of all interactive elements on the page, grouped by sections. Returns a markdown table with numbered references, types, descriptions, current values, and selectors. Use element numbers as selectors in browser_click and browser_type (e.g., selector '5'). 10x cheaper than screenshots for AI agent page understanding.",
7046
+ "tags": [
7047
+ "General"
7048
+ ],
7049
+ "requestBody": {
7050
+ "required": true,
7051
+ "content": {
7052
+ "application/json": {
7053
+ "schema": {
7054
+ "type": "object",
7055
+ "properties": {
7056
+ "context_id": {
7057
+ "type": "string",
7058
+ "description": "The unique identifier of the browser context (e.g., 'ctx_000001')"
7059
+ },
7060
+ "intent": {
7061
+ "type": "string",
7062
+ "description": "Task description to boost matching elements (e.g., 'buy nvidia jetson')"
7063
+ },
7064
+ "max_elements": {
7065
+ "type": "string",
7066
+ "description": "Maximum number of elements to return (0 = unlimited). Returns top N by importance score"
7067
+ },
7068
+ "region": {
7069
+ "type": "string",
7070
+ "description": "Filter to specific page region: 'main', 'nav', 'header', 'footer', 'sidebar', 'article', 'form', 'dialog'. Empty = all regions"
7071
+ }
7072
+ },
7073
+ "required": [
7074
+ "context_id"
7075
+ ]
7076
+ }
7077
+ }
7078
+ }
7079
+ },
7080
+ "responses": {
7081
+ "200": {
7082
+ "description": "Successful response"
7083
+ },
7084
+ "400": {
7085
+ "description": "Bad request"
7086
+ },
7087
+ "401": {
7088
+ "description": "Unauthorized"
7089
+ }
7090
+ }
7091
+ }
7092
+ },
6801
7093
  "/api/execute/browser_get_blocker_stats": {
6802
7094
  "post": {
6803
7095
  "summary": "Browser Get Blocker Stats",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olib-ai/owl-browser-sdk",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Node.js SDK for Owl Browser automation - Async-first with dynamic OpenAPI method generation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -22,6 +22,14 @@
22
22
  "./auth": {
23
23
  "import": "./dist/auth/index.js",
24
24
  "types": "./dist/auth/index.d.ts"
25
+ },
26
+ "./playwright": {
27
+ "import": "./dist/playwright/index.js",
28
+ "types": "./dist/playwright/index.d.ts"
29
+ },
30
+ "./extraction": {
31
+ "import": "./dist/extraction/index.js",
32
+ "types": "./dist/extraction/index.d.ts"
25
33
  }
26
34
  },
27
35
  "files": [
@@ -63,6 +71,7 @@
63
71
  "node": ">=18.0.0"
64
72
  },
65
73
  "dependencies": {
74
+ "cheerio": "^1.2.0",
66
75
  "jsonwebtoken": "^9.0.2",
67
76
  "ws": "^8.18.0"
68
77
  },