Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
Click button and get text with CeFSharp

I'm creating a program in vb.net to go to https://www.royalmail.com/track-your-item#/ and:

  1. Enter some text in the Reference Number box
  2. Click the button 'Track your delivery'
  3. Grab the text from the page so I can search for the delivery date

I've had to switch to using CeFSharp, as the microsoft browser doesn't want to load the page, so this is my first time with it.

This is what I have so far (CWB1 is the name of the browser object):

CWB1.LoadUrl("https://www.royalmail.com/track-your-item#")

CWB1.LoadUrl("javascript:void( document.getElementById( 'barcode-input' ).value='12345678' )")

Dim script = "var pagebutton = document.getElementById('submit');
pagebutton.click();"

CWB1.ExecuteScriptAsyncWhenPageLoaded(script)

The page loads, the text '12345678' is entered in the search box, but running the script to press the button does nothing.

I can't figure out how to press the button. I thought it must be the wrong id, but inspecting the web page seems to give button id="submit" so this should work? I've tried a few variations but nothing seems to move me forwards.

I also then need to grab the text from the page - not sure how to so this either?

Thanks for any help!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

OK, I've found that the button press only works if you enter the text in the field via sendkey event. So the button press code was working after all - I guess the site's security is trying to make sure someone is typing the text in, instead of a robot. Thanks for your help with this amaitland!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!