mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 20:54:59 +00:00
feat: Add option to return web scrape content instead of printing
This commit is contained in:
parent
77cb64958e
commit
52c49fc8fd
3 changed files with 5 additions and 3 deletions
|
@ -139,7 +139,7 @@ class Commands:
|
|||
else:
|
||||
self.io.tool_output("Please provide a partial model name to search for.")
|
||||
|
||||
def cmd_web(self, args):
|
||||
def cmd_web(self, args, return_content=False):
|
||||
"Scrape a webpage, convert to markdown and send in a message"
|
||||
|
||||
url = args.strip()
|
||||
|
@ -159,6 +159,8 @@ class Commands:
|
|||
|
||||
content = self.scraper.scrape(url) or ""
|
||||
content = f"Here is the content of {url}:\n\n" + content
|
||||
if return_content:
|
||||
return content
|
||||
|
||||
self.io.tool_output("... added to chat.")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue