For some use cases, you need to start crawler with URL(s) from other Zapier steps. Examples from our customers:

  • Use Push by Zapier button and scrape LinkedIn profile that you are currently on and push data to your CRM
  • Use Push by Zapier button to get some data of site you are currently on and save it to Google Spreadsheet
  • Use trigger from SaleForce on creating a new lead and scrape some data from the lead site and put data back to SalesForce

If you don't have any experience with Apify <> Zapier integration, you can read the article about Zapier integration first.

In this example, we use Zapier button to start our Zap and then we save title and URL of the page we are currently on. This example also shows how you can start crawler with URL(s) from previous Zap.
At first, we have to create a simple crawler which takes title and URL for given start URL. This crawler has simple page function:

function pageFunction(context) {
    // called on every page the crawler visits, use it to extract data from it
    var $ = context.jQuery;
    var result = {
        title: $('title').text(),
    };
    return result;
}

We also set up Max pages per crawl to 1 in the advanced setting because we want to crawl just one page. This crawler returns a simple result, where we have just URL and title of the page from start URL.

[{
  "title": "Example Domain",
  "url": "http://example.com/"
}]

When we have crawler ready we can move to set up our Zap in Zapier. If you don't have Zapier account you have to create it first. Then you can click on Make a Zap button in your Zapier dashboard. We choose Push by Zapier as the first step of Zap. Then we choose New push from the first select.

You would probably need to install chrome extension by Zapier, where you can click on Zapier button. After you successfully test the first step we choose Apify as the second Zap step. Then we choose action called Run Crawler.

After you click on Save and Continue you have to choose or connect your Apify account. Then we need to set up Crawler run action. In this step, we pass start URL to crawler using Crawler Properties.

As you can see we use URL from previous Zap step as value for start URL. We also choose our test crawler, which we created in the beginning. There is JSON, which we use as Crawler properties:

{
  "startUrls": [
    {
      "key": "",
      "value": "{{Value from precious step}}"
    }
  ]
}

With this set up you can click on Continue button and test your Zap. You should see a new crawler run in crawler console with values from our test run.

That's all, now you can go to any page in your browser and click on Push by Zapier button and you start new crawler run. Thanks for reading this article, I hope you found it useful. If you're missing something, you can contact us through chat.

Did this answer your question?