question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SubmitAsync taking too long (45 seconds)

See original GitHub issue

So, I downloaded this Demo from AngleSharp repository and all did was adding a break inside the foreach loop because there were some other elements that I didn’t want to fill and I also changed the form to Last instead of FirstOfDefault (because the first one is the search bar).

 public async Task SubmitForm(IDictionary<String, String> fields)
        {

            var document = _context.Active;
            var form = document.Forms.Last();
            var elements = form?.Elements ?? Enumerable.Empty<IHtmlElement>();
            int random = 0;

            foreach (var element in elements.OfType<IHtmlInputElement>())
            {
                if (random == 2)
                    break;
                
                if (fields.TryGetValue(element.Name ?? String.Empty, out string value))
                {
                    element.Value = value;
                }
                random++;
            }


            await form.SubmitAsync();

        }

`

 async void ExecuteSubmit()
        {

            IsLoading = true;
            await _accessor.SubmitForm(new Dictionary<String, String>(StringComparer.Ordinal)
            {
                ["user"] = "Aklim",
                ["passwrd"] = "azeqsd789456"
            });
            Update();
            var GetWelcomeMessage = _accessor.GetTextOf("div.tborder table:nth-child(2) tbody tr td.titlebg2 span");
            MessageBox.Show($"{GetWelcomeMessage}.");
        }

This is working fine, it’s just that SubmitAsync is taking too long to execute (45 seconds) and I’m not sure why exactly because if I connect manually, it goes smoothly. I’ve also tried the same code using the WebApp given in the demo, that was almost instant as well.

devenv_WUTb83J40Z

This is the login link (captcha): https://bitcointalk.org/index.php?action=login;ccode=540745379ff2169d1c1a

If that doesn’t work, you can login using the captcha manually, then visit https://bitcointalk.org/captcha_code.php to get the login link without captcha.

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
FlorianRapplcommented, Jul 5, 2020

Could you try with the improved HTTP requester from AngleSharp.Io @TonyDev314 ?

1reaction
TonyDev314commented, Jul 5, 2020

Perfect - fixes the issue.

Many thanks for the swift response - great library by the way!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Synchronization issue? in Anglesharp with async calls
If I use 2 accounts, then it works, but the SubmitAsync for the 1st account takes 45 seconds to complete. If I use...
Read more >
Merge contacts
Contacts are merged by the xConnect service layer after Submit() / SubmitAsync() has been called. The following example demonstrates how to perform a...
Read more >
Stripe JS Reference
js' APIs to tokenize customer information, collect sensitive payment details using customizable Stripe Elements, and accept payments with browser payment APIs ...
Read more >
The worst coder in the world tries an AI sidekick
A few seconds later the AI spits back a code block that uses jQuery and PHP with a MySQL database. For a hopeless...
Read more >
Provider Documentation - Apache TinkerPop
This document discusses Apache TinkerPop™ implementation details that are most useful to developers who implement TinkerPop interfaces and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found