Saltar al contenido

Pegue el nombre de usuario y la contraseña automáticamente en una página web específica - Paste the username and password automatically on a specific web page


Recommended Posts

Hola a todos, mi nombre es Maurizio
Y mi problema es este.
Realmente espero que me puedas ayudar, porque perdí toda esperanza de éxito.
El problema es este.
Estoy tratando de poner el nombre de usuario y la contraseña en una página preestablecida; Tomando el nombre de usuario de la celda Tengo la columna (B2) y la Contraseña los datos que inserto en la columna (C2)
Ahora, con respecto a la apertura de la página de Internet que quiero, no hay problema, este concepto es excelente y funciona muy bien.
El problema surge cuando quiero insertar siempre en la página web el nombre de usuario y la contraseña precargados por la celda (B2) (C2)
¿Cómo puedo resolver este problema?
Como siempre, un infinito agradecimiento a todos.
#########################################################################################################

Hello everyone, my name is Maurizio
And my problem is this.
I really hope that you can give me a hand on this because I lost all hope of success.
The problem is this.
I'm trying to put the username and password on a pre-set page; Taking the username from the cell I have column (B2) and the Password the data that I insert in the column (C2)
Now as regards the opening of the internet page I want, there is no problem this concept is great and works great.
The problem arises when I want to always insert in the web page the username and password pre-loaded by the Cell (B2) (C2)
How can I solve this problem?

As always, an infinite thank you to everyone

prova apertura web.xlsm

Enlace a comentario
Compartir con otras webs

Hola

Mira este ejemplo más simple como para que se entienda. Los índices de los objetos/elementos de usuario y contraseña son 1 no 0:

Sub Navegar()

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")

IE.Navigate "https://www.textnow.com/login"

Do Until IE.ReadyState = 4
 DoEvents
Loop

wit IE
    .Document.getElementsByName("username")(1).Value = Range("B2").Value
    .Document.getElementsByName("password")(1).Value = Range("C2").Value
    .Document.getElementsByClassName("authv2-wrapper2--centered ng-binding")(1).Click
End With

IE.Visible = True
Set IE = Nothing

End Sub

Saludos

Abraham Valencia

Enlace a comentario
Compartir con otras webs

Hola avalencia
Me disculpo pero no funciona
Abro la página web pero no indica el nombre de usuario ni la contraseña:

Y pensar que estoy intentando modificar todo de esta manera:
-------------------------------------------------- ----------------------------------------
Opción explícita

Sub BrowseToExchangeRates ()

    Dim IE As New SHDocVw.InternetExplorer
    Dim HTMLDoc As MSHTML.HTMLDocument
    Dim HTMLInput As MSHTML.IHTMLElement
    Dim HTMLAs As MSHTML.IHTMLElementCollection
    Dim HTMLA As MSHTML.IHTMLElement
    
    IE.Visible = True
    IE.navigate "https://www.textnow.com/login"
    
    Do While IE.ReadyState <> READYSTATE_COMPLETE
    bucle
    
    Establecer HTMLDoc = IE.Document
    
    'Establecer HTMLInput = HTMLDoc.getElementById ("cantidad")
    'HTMLInput.Value = 5
    
    Establecer HTMLInput = HTMLDoc.getElementById ("username")
   HTMLInput.Value = "prova1yopmail.fr"
    
    Establecer HTMLInput = HTMLDoc.getElementById ("contraseña")
    HTMLInput.Value = "123456"
    
    'Establecer HTMLAs = HTMLDoc.getElementsByTagName ("a")
    
    Para cada HTMLA en HTMLAs
        Debug.Print HTMLA.getAttribute ("classname"), HTMLA.getAttribute ("href"), HTMLA.getAttribute ("rel")
        
        Si HTMLA.getAttribute ("href") = "https://www.textnow.com/login" Y HTMLA.getAttribute ("rel") = "ratestable" Entonces
            HTMLA.Click
            Salida para
        Terminar si
        
    Siguiente HTMLA
    
End Sub

-------------------------------------------------- ----------------------------------
Pero no funciona de todos modos y no entiendo en qué me equivoco.
De todos modos, gracias Fin de Semana Infinito y Feliz.
çççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç

Traslation :
------------------------------------------------------------------------------------------------------------------

 

Hi avalencia
I apologize but it does not work
I open the Web page but does not indicate the username nor the password:

And to think that I'm trying to modify everything in this way:
-------------------------------------------------- ----------------------------------------
Option Explicit

Sub BrowseToExchangeRates ()

    Dim IE As New SHDocVw.InternetExplorer
    Dim HTMLDoc As MSHTML.HTMLDocument
    Dim HTMLInput As MSHTML.IHTMLElement
    Dim HTMLAs As MSHTML.IHTMLElementCollection
    Dim HTMLA As MSHTML.IHTMLElement
    
    IE.Visible = True
    IE.navigate "https://www.textnow.com/login"
    
    Do While IE.ReadyState <> READYSTATE_COMPLETE
    Loop
    
    Set HTMLDoc = IE.Document
    
    'Set HTMLInput = HTMLDoc.getElementById ("amount")
    'HTMLInput.Value = 5
    
    Set HTMLInput = HTMLDoc.getElementById ("username")
   HTMLInput.Value = "prova1yopmail.fr"
    
    Set HTMLInput = HTMLDoc.getElementById ("password")
    HTMLInput.Value = "123456"
    
    'Set HTMLAs = HTMLDoc.getElementsByTagName ("a")
    
    For Each HTMLA In HTMLAs
        Debug.Print HTMLA.getAttribute ("classname"), HTMLA.getAttribute ("href"), HTMLA.getAttribute ("rel")
        
        If HTMLA.getAttribute ("href") = "https://www.textnow.com/login" And HTMLA.getAttribute ("rel") = "ratestable" Then
            HTMLA.Click
            Exit For
        End If
        
    Next HTMLA
    
End Sub

-------------------------------------------------- ----------------------------------
But it does not work anyway and I do not understand where I'm wrong.
Anyway, thank you Infinite and Happy Weekend

Enlace a comentario
Compartir con otras webs

Hola,

Para hacer Web Scraping te recomiendo este objeto MSXML2.XMLHTTP60 es mucho más fiable que el IE Explorer y mucho más rápido. Quizás para Webs con Usuario y Contraseña sea un poco más complicado ponerlo en práctica pero te lo recomiendo en vez de usar el IE Explorer que está un poco obsoleto para extraer datos Web.

Igual el código que estás utilizando sea correcto pero la web no permite acceder a esos elementos, cada web es un mundo.

Estaría bien que pusieras la URL a la que quieres acceder después de hacer el login, hay algunas técnicas que acceden a esa URL enviando parámetros necesarios para hacer el login.

Saludos.

Enlace a comentario
Compartir con otras webs

hola,

Hola jos_santos
Gracias por su proverbial explicación, ciertamente también lo intento de esta manera; Aunque lo veo difícil porque sé muy poco lo que dijiste.
Pero si puede elevar su espíritu, simplemente le digo que después de una evaluación cuidadosa y precisa realizada en mi trabajo; Me las arreglé para resolverlo todo por mi cuenta.
Y si no se ofende, me gustaría ofrecerle una copia de mi trabajo terminado.
Hola y hasta pronto

hola,

Déjame saber lo que piensas gracias

########################################

Hello,

Hi José_Santos
Thank you for your proverbial explanation, I certainly also try this way; Even though I see it difficult because I know little what you said.
But if you can raise your spirits, I simply tell you that after a careful and accurate assessment made on my work; I managed to solve it all by myself.
And if you do not get offended, I'd like to offer you a copy of my finished work.
Hello and see you soon

Hello,

Let Me Know What You Think Thank You

Prova Apertura Pagina Web - Per Massimo Pedersoli.xlsm

Enlace a comentario
Compartir con otras webs

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

×
×
  • Crear nuevo...

Información importante

Echa un vistazo a nuestra política de cookies para ayudarte a tener una mejor experiencia de navegación. Puedes ajustar aquí la configuración. Pulsa el botón Aceptar, si estás de acuerdo.