'How to assign value to on Google image page using vba selenium
I am working on google reverse image,Now i design code for initial click and after first click i want to assign image url on google page but unable to assign image url to on web form.Following is my code,suggestion required regarding how to assign image url for search purpose.
Dim d As WebDriver
Set d = New ChromeDriver
d.Start "Chrome"
d.Get "https://www.google.com.pk/imghp?hl=en&
Sleep 3000
d.FindElementByXPath("/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[3]/div[2] /span").Click
d.Timeouts.ImplicitWait = 5000
d.FindElementByCss(".nfyh2c").SendKeys "https://canadiantire.scene7.com/is/image/CanadianTire/0653145_1?defaultImage=image_na_EN&wid=160&hei=160&op_sharpen=1 "
Solution 1:[1]
I resolve my issue using below mentioend code and updating my chrome webdirver,driver should same as your current chrome browser version.
Set myelement = d.FindElementById("Ycyxxc", timeout:=0, Raise:=False)
If myelement Is Nothing Then
MsgBox ("no element found")
Else
myelement.SendKeys ("https://canadiantire.scene7.com/is/image/CanadianTire/0580385_1?defaultImage=image_na_EN&wid=160&hei=160&op_sharpen=1")
End If
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Satti22 |
