Skip to content
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

Browser freeze and code stop without exception #56

Open
AAlex-11 opened this issue Jul 29, 2023 · 0 comments
Open

Browser freeze and code stop without exception #56

AAlex-11 opened this issue Jul 29, 2023 · 0 comments

Comments

@AAlex-11
Copy link

AAlex-11 commented Jul 29, 2023

This is my page factory, I expect 25 empty tabs

   Public Async Function EmptyPagesFactoryAsync(ByVal count As Integer) As Task(Of List(Of Page))
       Dim Pages As List(Of Page) = New List(Of Page)
       For i As Integer = 0 To count - 1
           Try
               ProxyCounter = (ProxyCounter + 1) Mod Proxys.Count
               Dim Proxy = Proxys(ProxyCounter)
               Dim ProxyURL = Proxy.Split("@")(1)
               Dim Extra = New PuppeteerExtraSharp.PuppeteerExtra
               Dim Browser = Await Extra.LaunchAsync(New PuppeteerSharp.LaunchOptions With {
                   .Headless = False,
                   .ExecutablePath = _config.GetSection("ChromePath").Value,
                   .Args = New String() {$"--proxy-server={ProxyURL}"}
               })
               Dim BrowserCredentials = New Credentials With {
                   .Username = Proxy.Split("@")(0).Split(":")(0),
                   .Password = Proxy.Split("@")(0).Split(":")(1)
               }
               Dim PageTask = Await Browser.NewPageAsync
               Await PageTask.AuthenticateAsync(BrowserCredentials)
               Dim cookies = JsonConvert.DeserializeObject(Of CookieParam)(File.ReadAllText("cookies.txt"))
               Await PageTask.SetCookieAsync(cookies)
               Pages.Add(PageTask)
               Browsers.Add(Browser)
           Catch ex As Exception
               _log.LogCritical(ex.Message & vbCrLf & ex.StackTrace)
           End Try
       Next
       Return Pages
   End Function

Proxy file read correctly, I'm sure. And proxies list is workable, because I use the same list in my other project based on TheArtOfDev automation, this means url and login/pass is correct. Chrome path also setting correctly, parameter also setting correctly --proxy-server==xx.xx.xx.xx:yyy. There are no any exception, but maybe I doing something wrong, because I see only one blank Chrome page after line "Dim Browser", than program stopped and line "Dim BrowserCredentials" never working.
Where is my mistake?

Interesting, if I downgrade PuppeteerSharp from last version to 7.10 and PuppeteerExtraSharp to 1.3.2 I receive another error in class AsyncMethodBuilderCore

AsyncMethodBuilderCore Error

What does it mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant