mercredi 17 mars 2021

multiple web page filing using excel vba

i have written a code that goes to a site fill in the details using excel but it involves a captcha so i have added a wait time of 50 second in this period i fill up the details in the web page then vba clicked submit button and vba goes to next page.

Now i am not able to enter any details on the next page opened. if i am using url than it is sending on the first page only so i am confuse how i can enter detais on second web page. code is as below

Option Explicit
Private bot As New selenium.ChromeDriver



Sub gift_code()


bot.Start "chrome", "https://starbuckscardredemption.com/index.html#/home/svc-Cashout-Eligibility/"
bot.Get "/"

bot.FindElementByName("giftCardNumber").SendKeys Sheet1.Range("A2").Value
bot.FindElementByName("pin").SendKeys Sheet1.Range("B2")
bot.FindElementById("state").SendKeys Sheet1.Range("C2")

bot.FindElementById("zipCode").SendKeys Sheet1.Range("D2")

Application.Wait (Now + TimeValue("0:00:20"))
 
 bot.FindElementByClass("btn btn-md btn1 btn-block").Click
  Application.Wait (Now + TimeValue("0:00:05"))
  
  bot.Start "chrome", "https://starbuckscardredemption.com/index.html#/home/svc-Cashout-CustomerDetails/"
bot.Get "/"
  bot.FindElementByName("firstName").SendKeys Sheet1.Range("B6")

End Sub



Aucun commentaire:

Enregistrer un commentaire