How do I scrap the current webpage URL in a CSV file?

How to copy the current webpage URL in a CSV file?

I tried this but it doesn’t work? what am I doing wrong?

{
  "Name": "URL",
  "CreationDate": "2020-12-1",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.yelp.com/biz/kc-paving-redwood-city-3?osq=paving+contractors",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!URL}",
      "Value": "!clipboard"
    },
    {
      "Command": "echo",
      "Target": "${!clipboard}",
      "Value": "!csvline"
    },
    {
      "Command": "csvSave",
      "Target": "url",
      "Value": ""
    }
  ]
}

There is no need to use the clipboard. This should work:

{
  "Name": "URL",
  "CreationDate": "2020-12-1",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.yelp.com/biz/kc-paving-redwood-city-3?osq=paving+contractors",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "${!URL}",
      "Value": "!csvline"
    },
    {
      "Command": "csvSave",
      "Target": "url",
      "Value": ""
    }
  ]
}

Im attempting the same thing and the script above runs without error but i dont know where the csv file is located. Could you please help me locate it?

csvSave stores the CSV file in browser download folder.

Thank you, it works, it saves the entire url. Is it possible to just store the domain name?

To store just the domain name you need to do some string operations (e. g. extract substring). For this, use ExecuteScript_Sandbox.

1 Like

Works even if i dont know what the url may be? Im a newb - i will be greatful if you could suggest the command and target, or clarify if i need to achieve this through more than 1 command. thank you lots