JavaScript button press emulation
In C#, the Chromium browser is installed, and it is required that when clicking the button in the program, the text field becomes active. The website used is - https://chat.deepseek.com/ - here it is necessary for the program to insert a message into the text field and send it. The code used only inserts the message into the text field, but it remains inactive until any key on the keyboard is pressed manually, meaning an emulation of pressing the enter or space key is needed.
The code that previously worked and correctly sent messages:
string script = "var input = document.querySelector('#chat-input');" +
$@"input.value = '{textBox1.Text}';" +
"var event = new Event('input', { bubbles: true });" +
"input.dispatchEvent(event);";
browser.ExecuteScriptAsync(script);
script = "var input = document.querySelector('#chat-input');" +
"input.dispatchEvent(new KeyboardEvent('keydown', { keyCode: 13, bubbles: true }));";
browser.ExecuteScriptAsync(script);
Client's review of cooperation with Aleks Klischuk
JavaScript button press emulationThe project was completed very quickly and with high quality.
Freelancer's review of cooperation with Anton Egorov
JavaScript button press emulationWonderful. Super. Excellent.
-
454 5 0 Good day! Write. I will do it in literally half an hour.............................
Current freelance projects in the category C#
Refinement of 1C UT 11 for Zebra TSD (RDP): different sound signals when scanning
22 USD
Configuration: 1C UT 11 Address warehouse Zebra TC26 TSD Work via RDP Product scanning is performed in receiving, placement, picking documents, and other warehouse operations. Current problem: Warehouse workers operate through the Zebra TSD. When scanning, they do not always… C#, Databases & SQL ∙ 8 days 12 hours back ∙ 7 proposals |