Skip to content

Update crawl_webpage.py #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/di/crawl_webpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"""

from metagpt.roles.di.data_interpreter import DataInterpreter
from metagpt.tools.libs.web_scraping import view_page_element_to_scrape

# from metagpt.tools.libs.web_scraping import view_page_element_to_scrape
# This function has been refactored in MetaGPT v0.7+version,
# and the web crawling related functions have been integrated into the scrape_web_playwright tool


PAPER_LIST_REQ = """"
Get data from `paperlist` table in https://papercopilot.com/statistics/iclr-statistics/iclr-2024-statistics/,
Expand All @@ -32,11 +36,14 @@


async def main():
di = DataInterpreter(tools=[view_page_element_to_scrape.__name__])

# di = DataInterpreter(tools=[view_page_element_to_scrape.__name__])

# The above has expired,Modify as follows:
di = DataInterpreter(tools=["scrape_web_playwright"])
await di.run(ECOMMERCE_REQ)



if __name__ == "__main__":
import asyncio

Expand Down
Loading