Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda