How to scrap the image url using "SRC" for google image seach result

I am trying to scrap the google image search result. So far the links and titles are all fine. But i am having difficulty getting the image url for each link show in the google image search result.

when i try to use the inspect function the link appears to be a messy code instead of a proper link.

this is what i get for one image link:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAD0APQMBIgACEQEDEQH/xAAcAAACAwEAAwAAAAAAAAAAAAAGBwMEBQIAAQj/xAA0EAABAwIEAwcCBQUBAAAAAAABAgMEBREAEiExBhNBIjJRYXGBkRShB0KCsfAVM2LB0Rb/xAAZAQADAQEBAAAAAAAAAAAAAAACAwQAAQX/xAAlEQACAgICAQMFAQAAAAAAAAABAgADESEEEjEiQVFhcYGh8BT/2gAMAwEAAhEDEQA/AFXJbkR221yGHGkupzNqcSQFja4vvjR4PoqOI62mC9JMdoNqdUpIBUoAgZU30uc2GgOA4HDtpiXJUvMkpHNDa0J66gjC/qLEx+YGY0XL9UrsLYayl9SSQNRpoQdBYdegxEOULchTj6yyviBnwDr6xo8AUvh2huSUUySmSp9dlOurSs2T+W4sNCTsOuLPGtSiUUti+VLoKzY3I1Gw/m2A6DwNXoEvnQpaGGFDNnU5ZQ02KSLXvsfDEMpNXrDwRUqO+3yG7KfWTbTUa7K/T47Y85xmzv2zj8GWJx0Ayra+IXtVp/6Ba2isKy2SojA1wzWlxKjLqHPUpEtYUtV77aA/AwQ8P16AsJpDyQ2+6rlLC97npb3xDI/DmNSYqU0WRJdKdVNTFhSVDbQhIsevhgX5FlwIsP2goldTdeujNF9UOty1SYzwQ6hpN3LaL30PiNv5fFmhOMRY7iX0lEha86+ZYki1gRbpYfb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cxnMOxDHa/vlGUN9QfPAHKonOjpiVVWTkSucpDYsXCNU6+Go219MHVFZacUl8oHMy7+WPdXgsyak2lxPebOo9R/wBx3l8f/FX2rOzqTca/uSp8RY8Q096fKpsiMsJVEd1Cie4SL2+PvixwMhiO3KkJdes++orCyMiCTfQdNxizWH+Y7KhMoSylLxZKxqpQCrH0vienQRTafzWl3JVnII9rfbAU1O1LA/EZc40IeTG81MUncgBSFjprtgebrMaFK5cnmFaTlytpza+vvjQqUxYpMdoAj6jdSVWKQLHS3tjPqMFFMpsFbCiWlOKAQoXIURe+bf8AL1wmnm20gqkw49bgd5l8brmokw684FJgtOJYUhY7qVfmt4XFv1Y1nKrTZkGKmoNFS28wTlF9DbX+eGMr8RJ7h4chw7dmS8CtV+iRcD5t8YDoNUlQWAygocQO6HATlHgNdsEKnuUWe8wYL6D4Hif/2Q==

does anyone know how to get the thumbnail image links? thank you so much!!!

Hi @Penganimation,

  • Use Get attribute activity and indicate the image
  • Set Attribute value as ‘src’ and get the result as string from Output property

@Penganimation
the image src is not an url. It is a base64 encoded string.

Give a try on following:

decode the string save the bytes in a file

3 Likes

Thank you Peter for your help again. I am downlaoding a text file instead of a uipath file. And there is no instructions on how to use it. I am not a programmer so I am kind of stuck here. haha…

@Penganimation
I will try to have a look on this in my evening.
Please check 1 url from your needs and, identify 1 image and share this info with us.
So we can work taskoriented the right things.

Thanks

thank you for the tip. I think this is what i already have.

I have this url which is one of my current search that i want to scrap the images.

https://www.google.com/search?tbs=sbi:AMhZZitarxSZZeCBePDvS39RAga4xHODsC7bEklOMl-MoO8S7O0JF64h4imUGKOmC-Q19DRs0iUkP5MzV6ivTtCX5g5R0Uon8nymhDy5GDhk4XFQBR9LpeNAObZdUDem7TETJZeVTFI4qtiZ41ExaFaCYNxdTJXZ9zrx3q0UHz0VsQhBPkPufUHDgpZbaucOGVN36qNF6I2_1Km4SjbzuB_1uvjbJFoAQeSKeejO5KrtXOymEXi23Yx9Ddz3kyJ6VzLg3yH2Zra4g5wC2io6KhS4xz52XxE8V-EM2HihdXePAi_1C6-dtF9ThzBCiSHLaKgWwYWif8cHqSb&btnG=Search%20by%20image&hl=en-SG

@Penganimation
as a quick starter (later it can be beautified):
Dim imageBytes As Byte() = Convert.FromBase64String(YourBase64String)
File.WriteAllBytes(“image.jpg”, imageBytes)

But remove from Start:
data:image/jpeg;base64,/9j/

data:image/jpeg;base64,
and let start the image data by: /9j/

1 Like

Thank you very much Peter, I think I still need a lot more learning on this. Meanwhile I am trying out another method to work around my current problem. Again appreciate it a lot!!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.