Spaces:
Sleeping
Sleeping
Commit
·
8b441ff
1
Parent(s):
95320f9
test3
Browse files- scraper/html_loader.py +2 -3
- server.py +1 -3
scraper/html_loader.py
CHANGED
|
@@ -15,9 +15,8 @@ class HTMLLoader:
|
|
| 15 |
|
| 16 |
async def __aenter__(self):
|
| 17 |
self.playwright = await async_playwright().start()
|
| 18 |
-
self.browser = await self.playwright.
|
| 19 |
-
|
| 20 |
-
)
|
| 21 |
self.context = await self.browser.new_context(
|
| 22 |
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
| 23 |
)
|
|
|
|
| 15 |
|
| 16 |
async def __aenter__(self):
|
| 17 |
self.playwright = await async_playwright().start()
|
| 18 |
+
self.browser = await self.playwright.firefox.launch(headless=True)
|
| 19 |
+
|
|
|
|
| 20 |
self.context = await self.browser.new_context(
|
| 21 |
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
| 22 |
)
|
server.py
CHANGED
|
@@ -32,8 +32,6 @@ with gr.Blocks(title="MCP Web Scraper") as demo:
|
|
| 32 |
scrape_button.click(scrape, inputs=url_input, outputs=output)
|
| 33 |
|
| 34 |
if __name__ == "__main__":
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
os.environ['no_proxy'] = 'localhost, 127.0.0.1, ::1'
|
| 38 |
#demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 39 |
demo.launch(mcp_server=True)
|
|
|
|
| 32 |
scrape_button.click(scrape, inputs=url_input, outputs=output)
|
| 33 |
|
| 34 |
if __name__ == "__main__":
|
| 35 |
+
#os.environ['no_proxy'] = 'localhost, 127.0.0.1, ::1'
|
|
|
|
|
|
|
| 36 |
#demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 37 |
demo.launch(mcp_server=True)
|