Open url from csv


#1

How to call / refer url (website name) from csv ?

Tried
Command: Open
Target:
Value: ${!COL1}

Tried the target as blank and browser but no luck.


#2

${!COL1} should be in the 2nd column (called “Target”), see OPEN.

And before this, use csvRead to read the data.

Here is a macro that does this (plus takes screenshot of the loaded page):

{
  "CreationDate": "2018-6-27",
  "Commands": [
    {
      "Command": "csvRead",
      "Target": "url.csv",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "${!col1}",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "Remove non alphanumeric chars from URL, so we can use it as screenshot file name",
      "Value": ""
    },
    {
      "Command": "storeEval",
      "Target": "var string = \"${!col1}\"; var stripped = string.replace(/[^A-Za-z0-9]/g, ''); stripped;",
      "Value": "alphanumericonly"
    },
    {
      "Command": "captureScreenshot",
      "Target": "screenshot_for_${alphanumericonly}",
      "Value": ""
    }
  ]
}

The CSV file is just a list of URLs e. g.

https://a9t9.com
https://ocr.space
https://forum.a9t9.com

:exclamation: Run the macro in a loop to read all URLs from the CSV.


Video demonstration of doing an automatic screenshot and a user question
#3

Thanks for quick response but it’s not working.
Showing as “status] Playing macro test”.

Earlier it was opening “chrome-extension://gcbalfbdmfieckjlnblleoemohcganoc/$%7B!COL1%7D”
and log shows below:
[error]
until: ipc of tab to play expired!


#4

If I open a web page and later use the above mentioned code, it’s working.

{
“CreationDate”: “2018-6-28”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://www.msn.com/sv-se/”,
“Value”: “”
},
{
“Command”: “csvRead”,
“Target”: “urls.csv”,
“Value”: “”
},
{
“Command”: “open”,
“Target”: “${!COL1}”,
“Value”: “”
}
]
}

Looks like a defect !!!
Expecting web page to continue the steps.


#5

Kantu (like any Chrome extension) can only work on pages that have “something” loaded using the http://, https:// or file:// protocol.

So if you start the macro while (for example) chrome://settings/clearBrowserData or the Chrome start page is open, it can not connect to the browser tab. That is why adding a Open at the very top solves it.

That said, csvRead (unlike, say, Click or Type) should not require any web page (tab) connection, so indeed, it looks there is a bug here. I added this to our todo list, thanks for reporting it!


#6

Thanks for fixing the bug, it’s working fine now.


#7

This defect looks like still existing when we leave the page for long time.
It’s working fine after closing chrome and reopening!!!


#8

IPC issues are fixed with Kantu V3.1.6 :grinning: