You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a py test script. There was no problem when I requested the test interface for the first time, but after the second time, it started to report an error error: BrowserType.launch: Target page, context or browser has been closed
my code:
import asyncio
from crawl4ai import AsyncWebCrawler
from crawl4ai.async_configs import BrowserConfig
from flask import Flask, jsonify
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I wrote a py test script. There was no problem when I requested the test interface for the first time, but after the second time, it started to report an error error: BrowserType.launch: Target page, context or browser has been closed
my code:
import asyncio
from crawl4ai import AsyncWebCrawler
from crawl4ai.async_configs import BrowserConfig
from flask import Flask, jsonify
app = Flask(name)
@app.route('/test', methods=['GET'])
def test():
async def _async_test():
# Prepare browser config with cookies
browser_config = BrowserConfig(
headers={"Accept-Language": "en-US,en;q=0.9"},
headless=False,
verbose=True
)
if name == 'main':
app.run(host='0.0.0.0', port=5001)
Beta Was this translation helpful? Give feedback.
All reactions