Firoj112 commited on
Commit
30483de
·
verified ·
1 Parent(s): 05b51b9

Update tools/scrape_text.py

Browse files
Files changed (1) hide show
  1. tools/scrape_text.py +11 -3
tools/scrape_text.py CHANGED
@@ -40,12 +40,20 @@ def scrape_text(driver, selector="p", extract_table=False):
40
  return f"Failed to scrape with selector {selector}: {str(e)}"
41
 
42
  # Register the tool
43
- tool = Tool(
44
  name="scrape_text",
45
  description="Scrapes text or table data from elements matching a CSS selector on the current page.",
46
  inputs={
47
- "selector": {"type": "str", "default": "p", "description": "CSS selector to target elements"},
48
- "extract_table": {"type": "bool", "default": False, "description": "If True, extract table data as JSON"}
 
 
 
 
 
 
 
 
49
  },
50
  output_type="str",
51
  function=scrape_text
 
40
  return f"Failed to scrape with selector {selector}: {str(e)}"
41
 
42
  # Register the tool
43
+ scrape_text_tool = Tool(
44
  name="scrape_text",
45
  description="Scrapes text or table data from elements matching a CSS selector on the current page.",
46
  inputs={
47
+ "selector": {
48
+ "type": "str",
49
+ "default": "p",
50
+ "description": "CSS selector to target elements"
51
+ },
52
+ "extract_table": {
53
+ "type": "bool",
54
+ "default": False,
55
+ "description": "If True, extract table data as JSON"
56
+ }
57
  },
58
  output_type="str",
59
  function=scrape_text