Can we somehow sense the element type/id/size while tabbing around on a webpage

My plan is to collect the URLs of the individual photos shown like here on Google Maps.

I can tab from pic to pic and hit SHIFT + F10 to simulate a right-mouse click, and then hit the down arrow 4 times to reach the “Copy image address” in Chrome on Win 10. Works great. Then I continue tab x 3 to reach the image. But some places on Google maps have more than a single image. Then tabbing between images needs only two and not 3 tabs.

What strategy can I use to solve this challenge = that I don’t know if there are 3 or 2 tabs to the next image?

I can copy the entire content of the left panel and paste it to a text file where the number of lines between each place is proportional to the number of pics uploaded to each pic. But then I will need to somehow create individual macros for each place. And I have no idea if this is too meta or even possible.

So I was wondering if just trying to copy the image address after each tab would be the way to go and then later programmatically in PHP filter away irrelevant URLs.

Or is there a way to sense/detect what type of element is selected and from there decide to copy the image address or tab to the next element.

Sorry for typing so much for a simple question.

Cheers
Morten

If you want to see the webpage. Here is the link:

https://www.google.com/maps/contrib/116647701492246965139/photos

Cheers

To use your solution yiu need xmodules pro because with free edition you can use max 25 xclck/xtype commands.

Read limit here:
https://ui.vision/rpa/x/pricing

Your work must be organized in better way to use a few amount of xclck/xtype commands.

Your problem is store the url of all images in left column ?

There are more images in left column what is the criteria to choice an image ?

Hi @newuserkantu

I thought Xmodules was necessary if you wanted to cross over to other programs on your PC and not when staying inside a browser. I will study the pricing and decide when I’m sure it can work.

I thought going clicks was better and faster than image recognition.

I need to store the URLs of the first 100 pics (only)

I plan to use some Page-Down clicks to load the photos into the RAM delays later in the process.

Alternatively, I could view and copy the source code of the iframe and then isolate the links from there. It might be easier in the end.

Thanks again for taking a look and helping.

Morten

This is an hard macro to do require a coder and more time because every block of images have a different xpath, is not a simple work to do in the forum.

This macro require scroll of page, and detection of block of image with different xpath.

Create this macro without error is very hard, in my opinion can not create here in few time…

Your solution do not check error because with xmodules you emulate the keyboard (desktop automation) and errors will not saved, your macro code will create more errors.

1 Like

I create for you a custom macro, it’s more fast and easy to use

It require the number of image to save with prompt, after scroll the page and grab all images url and save it in a csv and show notify.

It save the image url in a csv and never use keyboard emulation and xmodules, you can use it free without xmodules.

Macro Code

{
  "Name": "Store_Image_Url",
  "CreationDate": "2020-6-11",
  "Commands": [
    {
      "Command": "store",
      "Target": "true",
      "Value": "!errorignore"
    },
    {
      "Command": "prompt",
      "Target": "Add The Number Of Image To Scrape @1",
      "Value": "ImageNumber"
    },
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://www.google.com/maps/contrib/116647701492246965139/photos/@55.6696476,12.4506104,12z/data=!3m1!4b1!4m3!8m2!3m1!1e1",
      "Value": ""
    },
    {
      "Command": "waitForPageToLoad",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "times",
      "Target": "${ImageNumber}",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "Make A Click To Scroll Page",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=(//img[contains(@src,'-p-k-no')])[${!TIMES}]",
      "Value": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=(//img[contains(@src,'-p-k-no')])[${!TIMES}]@src",
      "Value": "ImageUrl"
    },
    {
      "Command": "store",
      "Target": "${ImageUrl}",
      "Value": "!csvLine"
    },
    {
      "Command": "csvSave",
      "Target": "ImageUrl.csv",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${ImageUrl}",
      "Value": "#shownotification"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}

Datasouce after saving image url
result

1 Like

Wow, @newuserkantu

I spend the entire day writing PHP code to find and extract this information. And now I see this. Thank you so much. I will give it a spin. I wonder how you fixed the issue of moving to the next image when you are not using tabs.

I will report back after testing.

Morten

To bypass the multiple image merged I used a generic xpath that recognize url image and start from first image url and continue to search in the page.

You used keyboard emulation (not good solution), I used selenium commands and i can check the status of work (with keyboard emulation you can not check status macro).

I tryed it with your profile but i think it work in all profiles depending from the url structure.

Google images are not classic images like .jpg or .png, use a different strange format and I detect it with this part -p-k-no.

Remember before create a macro think the short code and easy code, short code are fast and with few chances of freezing or bugs.

Try it and inform about the results.

1 Like

Hey @newuserkantu

This is really really amazing.
What a huge potential UI.Vision has. It was not clear to me from watching videos and studying the website.

Here are my thoughts in random order:
It is a bit slow, but I can try making small adjustments.
I removed the echo command. Too much noise :wink:
I’m impressed that the pages don’t need to be preloaded.
Only the first time I saw the “Macro completed running” message. So I need to guess when it is done.
It works nicely on other profiles also.
I guess the slow speed and since it is not coming from a serve Google is likely not to refuse service (they can not detect that it a macro and to a human).

Thanks again.

I will need to test how I can scrape the remaining values I need from the google maps profile
And how I can get access to the CSV file from another server
I will also change the prompting from asking for the number of pics wanted to the Google Maps user ID number.

All the best
Morten

I added echo command with url extracted to check the work, every automation can fails (if the page change or the page is not full load), I usually add an echo to see the work and detect bugs.

You can set the speed from an internal command of ui vision replayspeed

https://ui.vision/rpa/docs#!replayspeed

Ui vision can do more works but need to know the best command for every work and there are a large amount of commands to study

https://ui.vision/rpa/docs/selenium-ide

1 Like