mercredi 28 mai 2014

VBA Excel Get Updated Web-Page Data


Vote count:

0




Situation:



  • A website has a unique 6-digit id for every product name

  • When a user types in a name of a product he/she is searching for, a dropdown list appears with potential choices (very similar to google/amazon)

  • In HTML the dropdown list is generated by "ul li... /ul" portion that contains id for each product

  • I'm trying to figure out a way to get the id of the first product choice


Code:



IE.navigate "website" 'load the website

Do While IE.readyState <> 4 Or IE.Busy = True
Application.Wait Now() + TimeValue("00:00:01")
DoEvents
Loop

'punch in the name of a product
IE.document.getElementById("query").Value = "Product A"


Here is the problem, the "ul li... /ul" is dynamically generated after .Value = "Product A" takes place. Is there any way to update IE object so it includes the "ul li... /ul" portion?



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire