Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Seleccionar un objeto de un código fuente

publicado

Buenas, estoy tratando de automatizar un carro de compras para armarlo con macro, hasta el momento puedo abrir una web, seleccionar algún item por posición en el codigo fuente y agregarlo al carro, se que voy bien encaminado,

 

Sub test()

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

    With IE
        .Top = 0
        .Left = 0
        .height = 1000
        .Width = 1050
        .Visible = True
        .Navigate "https://store.channelfireball.com/catalog/magic_singles-saga_block-urzas_saga/duress/17412"

        Do While .Busy Or Not .ReadyState = 4: DoEvents: Loop

        .Document.getElementsByClassName("add-to-cart-form")(0).getAttribute("NM-Mint, English")(0).getElementsByClassName("qty")(0).Value = "3"
        .Document.getElementsByClassName("utility-button add-to-cart")(0).getAttribute("NM-Mint, English")(0).Click
       
    End With
End Sub

 

pero no logro dar con el resultado que quiero. en el código, si elimino la parte ".getAttribute("NM-Mint, English")(0)" la macro se ejecuta utilizando la posición del botón en el código fuente, puede rellenar el campo de cantidad y apretar el botón para agregar al carro, pero necesito realizar un pequeño filtro por el texto que contiene el elemento (no utilizar la posición), en este caso "NM-Mint, English" o "Slightly Played, English," en algunos casos, el orden de estos varia, dependiendo de cada articulo que este mirando, por lo que no puedo utilizar posición, debo realizar algún filtro, agradecería mucho su ayuda. 

 

saludos

Editado el por Galactico

Featured Replies

No hay posts para mostrar

Archivado

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.