U
U
Uncle Bogdan2021-08-06 12:10:21
C++ / C#
Uncle Bogdan, 2021-08-06 12:10:21

FrameLoadEnd not firing on page load?

The trick is that when the page loads, you need to execute the method.

Why doesn't it work in this case?

Doesn't work with FrameLoadEnd :(

bool GoToPrintCard = false;

            if(CanPrint && angle.QuerySelector("#b-case-header > ul.b-case-overview.g-ec > li.case-print > a") != null)
            {
                browser.ExecuteScriptAsync("document.querySelector('#b-case-header > ul.b-case-overview.g-ec > li.case-print > a').click();");
                GoToPrintCard = true;
            }

            if(GoToPrintCard)
            {
                await Task.Run(async delegate
                {
                    while (true)
                    {
                        if (angle.QuerySelector("#print > div.b-print-container > div.b-card-modes > a") != null)
                        {
                            await browser.PrintToPdfAsync(@"C:\Program Files (x86)\ArbitrPdfFiles\1");

                            break;
                        }
                    }
                });
            }

        private async void button3_Click(object sender, EventArgs e)
        {
            await CreatePdf();
        }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question