We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
i use these codes to get news real time from a website its have get news 2000 response per minutes
but after 30 min when i get 100000 news the chromium show this error "Aw Snap!" Error Code: Out of Memory
see my code have leak memory or any problem ? how to solve it ?
` public async Task StartService() { var playwright = await Playwright.CreateAsync(); var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions { Headless = false });
var context = await browser.NewContextAsync(); var page = await context.NewPageAsync(); await page.GotoAsync("https://test.com", new PageGotoOptions { WaitUntil = WaitUntilState.Load // Ensure full page load }); var signUpButton = page.Locator("text=Sign up for "); await signUpButton.WaitForAsync(new LocatorWaitForOptions { State = WaitForSelectorState.Visible }); await signUpButton.ClickAsync(); await Task.Delay(2000); await page.Locator("//input[@name='text']").ClickAsync(); // تمرکز روی input await page.Locator("//input[@name='text']").FillAsync("jame_stown51080"); var NextButton = page.Locator("text=Next"); await NextButton.WaitForAsync(new LocatorWaitForOptions { State = WaitForSelectorState.Visible }); await NextButton.ClickAsync(); await page.WaitForSelectorAsync("//input[@name='password']"); await page.Locator("//input[@name='password']").ClickAsync(); await page.Locator("//input[@name='password']").FillAsync("xxxxxxxxxxxxxxxxxxxxx"); var loginButton = page.Locator("[data-testid='LoginForm_Login_Button']"); await loginButton.ClickAsync(); try { page.Response += async (_, response) => { if (response.Ok && response.Url.Contains("SearchTimeline")) { indexViewModel.Response_Count++; var body = await response.TextAsync(); await GeNews(body); body = null; response = null; GC.Collect(); GC.WaitForPendingFinalizers(); await page.Mouse.WheelAsync(0, 10); } }; await page.WaitForSelectorAsync("[data-testid='cellInnerDiv']"); // Replace with actual test ID await page.WaitForLoadStateAsync(LoadState.Load); } catch (Exception ex) { throw; }
}`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i use these codes to get news real time from a website
its have get news 2000 response per minutes
but after 30 min when i get 100000 news the chromium show this error
"Aw Snap!" Error Code: Out of Memory
see my code
have leak memory or any problem ?
how to solve it ?
` public async Task StartService()
{
var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions
{
Headless = false
});
}`
The text was updated successfully, but these errors were encountered: