<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pratik Parmar</title>
    <description>The latest articles on DEV Community by Pratik Parmar (@hackyroot).</description>
    <link>https://dev.to/hackyroot</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F169458%2F65e0499f-5dcf-44e6-8c06-0bf8a8dc0723.jpeg</url>
      <title>DEV Community: Pratik Parmar</title>
      <link>https://dev.to/hackyroot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hackyroot"/>
    <language>en</language>
    <item>
      <title>No Code Scraping: Using No Code tools to Scrape an eCommerce site and send an alert text using Zyte API, n8n, and Telegram</title>
      <dc:creator>Pratik Parmar</dc:creator>
      <pubDate>Tue, 21 Feb 2023 20:26:00 +0000</pubDate>
      <link>https://dev.to/hackyroot/no-code-scraping-using-no-code-tools-to-scrape-an-ecommerce-site-and-send-an-alert-text-using-zyte-api-n8n-and-telegram-4if3</link>
      <guid>https://dev.to/hackyroot/no-code-scraping-using-no-code-tools-to-scrape-an-ecommerce-site-and-send-an-alert-text-using-zyte-api-n8n-and-telegram-4if3</guid>
      <description>&lt;p&gt;As an audiophile, I am always on the lookout for deals on headphones, speakers and quality AV. Headphone Zone is my go-to place for such purchases, as they regularly host clearance sales and I love a deal too.🤑&lt;br&gt;
However, I often miss out on these sales because the emails announcing them get lost in the flood of promotional emails and spam I receive, and I don’t want to visit these sites every day. So I’d much rather have an alert sent to my telegram account when there is a sale.&lt;/p&gt;

&lt;p&gt;So, being a geek I am I decided to see if I could use some simple no-code tools (because why not) and a web scraping API (&lt;a href="https://app.zyte.com/account/signup/zyteapi?utm_campaign=Comt&amp;amp;utm_activity=BLOG&amp;amp;utm_medium=ORG&amp;amp;utm_source=3CNT&amp;amp;utm_referrer=Pratik&amp;amp;utm_primary=ZDAPI&amp;amp;utm_secondary=ZDAPI&amp;amp;utm_goal=SIN" rel="noopener noreferrer"&gt;Zyte API&lt;/a&gt;) to create a system that sends me a notification whenever there is a clearance sale on Headphone Zone. &lt;/p&gt;

&lt;p&gt;This way, I can be sure not to miss out on any great deals on audio devices. &lt;br&gt;
The good news is it was surprisingly easy, so I’m going to show you do it too. Sounds fun, right? Let's get started. 🚀&lt;/p&gt;
&lt;h2&gt;
  
  
  How it's going to work:
&lt;/h2&gt;

&lt;p&gt;What you’re going to do is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup a no-code tool (&lt;a href="https://n8n.io/" rel="noopener noreferrer"&gt;n8n&lt;/a&gt;) to manage the various tools and tasks needed&lt;/li&gt;
&lt;li&gt;Setup a web scraping API and scrape the site to monitor the site every day
&lt;/li&gt;
&lt;li&gt;Detect if there is a sale on&lt;/li&gt;
&lt;li&gt;Send an alert to my phone via telegram&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  1. Introduction to n8n and Zyte API
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://n8n.io/" rel="noopener noreferrer"&gt;n8n&lt;/a&gt; is a no-code workflow automation tool. It allows you to automate data-driven processes and connect your apps into a single workflow. n8n provides a drag-and-drop user interface that enables you to build workflows without writing any code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.zyte.com/zyte-api/get-started/sign-up.html#zyte-api-sign-up?utm_campaign=Comt&amp;amp;utm_activity=BLOG&amp;amp;utm_medium=ORG&amp;amp;utm_source=3CNT&amp;amp;utm_referrer=Pratik&amp;amp;utm_primary=ZDAPI&amp;amp;utm_secondary=ZDAPI&amp;amp;utm_goal=SIN" rel="noopener noreferrer"&gt;Zyte API&lt;/a&gt; is an API that aims to solve all web data extraction needs. It comes with a built-in, transparent anti-ban solution with IP rotation, browser emulation, and website-specific fine-tuning. In a nutshell, Zyte API will ensure you don't get ban-hammered and delivers your data without any hiccup.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Prerequisites: Setting up n8n and acquire Zyte API Key
&lt;/h2&gt;
&lt;h3&gt;
  
  
  2.1 &lt;strong&gt;n8n&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;Easiest way to get started with n8n is the desktop app.Check out the quickstart &lt;a href="https://docs.n8n.io/try-it-out/quickstart/" rel="noopener noreferrer"&gt;guide&lt;/a&gt; for more information. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqx2u6yy7n5fy1oyacacx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqx2u6yy7n5fy1oyacacx.png" alt="n8n Workflow"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2.2 &lt;strong&gt;Zyte API Key&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;For Zyte API, you just need to sign up at &lt;a href="https://app.zyte.com/account/signup/zyteapi?utm_campaign=Comt&amp;amp;utm_activity=TPC&amp;amp;utm_medium=ORG&amp;amp;utm_source=3CNT&amp;amp;utm_referrer=Pratik&amp;amp;utm_primary=ZDAPI&amp;amp;utm_secondary=ZAE" rel="noopener noreferrer"&gt;https://app.zyte.com/account/signup/zyteapi&lt;/a&gt; and fetch the Zyte API key. For step by step guide, you can refer to this &lt;a href="https://docs.zyte.com/zyte-api/get-started/sign-up.html#zyte-api-sign-up?utm_campaign=Comt&amp;amp;utm_activity=TPC&amp;amp;utm_medium=ORG&amp;amp;utm_source=3CNT&amp;amp;utm_referrer=Pratik&amp;amp;utm_primary=ZDAPI&amp;amp;utm_secondary=ZAE" rel="noopener noreferrer"&gt;guide&lt;/a&gt;. Keep this API key handy, we will be using this API later in the workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vgi3oen0kb7l2btdjws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vgi3oen0kb7l2btdjws.png" alt="Acquire Zyte API Key"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2.3 &lt;strong&gt;Telegram Bot Credentials (optional)&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;On Telegram, chat with BotFather and create a new bot. BotFather will provide a bot token, which can be used to integrate the bot into any platform. &lt;/p&gt;

&lt;p&gt;One last thing we’ll need is a Telegram Chat ID. &lt;br&gt;
Check out this &lt;a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/#how-do-i-add-a-bot-to-a-telegram-channel" rel="noopener noreferrer"&gt;guide&lt;/a&gt;  to learn how to get a chat ID. &lt;/p&gt;

&lt;p&gt;You can skip this step, if you don’t want to use the Telegram node.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. How web scraping workflow works in n8n
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pass the website URL you want to scrape in the cURL. Here it’s &lt;code&gt;https://www.headphonezone.in/collections/clearance&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Using the HTTP request node, make a Zyte API call to fetch the HTML content&lt;/li&gt;
&lt;li&gt;Use the HTML Extract node to extract data from the HTML content&lt;/li&gt;
&lt;li&gt;Clean the data and send it over using the Telegram node.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  4. Configuring the workflow
&lt;/h2&gt;

&lt;p&gt;To create a new n8n workflow, just head over to the &lt;code&gt;workflow&lt;/code&gt; and click on &lt;code&gt;new&lt;/code&gt; to create a new workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32f0tczq2i6i2v2a1oxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32f0tczq2i6i2v2a1oxi.png" alt="Create new n8n workflow and add a new node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The n8n workflow is made up of small executable blocks known as &lt;a href="https://docs.n8n.io/workflows/components/nodes/" rel="noopener noreferrer"&gt;nodes&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You can install any nodes by clicking on the "+" button in the top right corner of the n8n dashboard and selecting from the list of available nodes.&lt;/p&gt;
&lt;h3&gt;
  
  
  4.1 Getting the website data
&lt;/h3&gt;

&lt;p&gt;In order to download the HTML data from the website we will need an HTTP Request node. After adding it to your workflow, you will need to specify the website URL you want to scrape. You can also specify any other request parameters, such as the method, headers, and body, as needed.&lt;/p&gt;

&lt;p&gt;Alternatively, you can use cURL to configure this node. Click on &lt;code&gt;Import cURL&lt;/code&gt;. Paste the following cURL request and import it. Make sure that you’ve updated your Zyte API key here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl \
   --user YOUR_ZYTE_API_KEY_HERE: \
   --header 'Content-Type: application/json' \
   --data '{"url": "https://www.headphonezone.in/collections/clearance", "browserHtml": true}' \
   https://api.zyte.com/v1/extract
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the node configuration, go to options and add a &lt;code&gt;Response&lt;/code&gt; option. Set the response format as &lt;code&gt;Text&lt;/code&gt; and set &lt;code&gt;Put Output in Field&lt;/code&gt; as &lt;code&gt;response&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Click on execute to ensure everything is working properly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwqd9ibm1tzatkcto3uk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwqd9ibm1tzatkcto3uk.png" alt="HTTP Request Node configuration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 Fetch HTML Content using a Set Node
&lt;/h3&gt;

&lt;p&gt;Now if you noticed, the response from the HTTP Request node is in the JSON. For our workflow, we only need the browserHtml though, which is the HTML content of the webpage. We can use the &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/" rel="noopener noreferrer"&gt;Set node&lt;/a&gt; to create another field ‘data’ and assign &lt;code&gt;browserHtml&lt;/code&gt; to that field.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep Only Set: Enable&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Values to Set:&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Name: &lt;code&gt;data&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Value: &lt;code&gt;{{$json["response"]["browserHtml"]}}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This node will fetch the browserHtml field from the response field which is a JSON field, and set it to the data field of string data type.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqg3xuszjealfvhfo0xgx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqg3xuszjealfvhfo0xgx.png" alt="Configure Set Node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 Extracting Product Data from the HTML Data
&lt;/h3&gt;

&lt;p&gt;In the &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.html/?utm_source=n8n_app&amp;amp;utm_medium=node_settings_modal-credential_link&amp;amp;utm_campaign=n8n-nodes-base.htmlExtract#extract-html-content" rel="noopener noreferrer"&gt;HTML Extract node&lt;/a&gt;, you can use &lt;a href="https://docs.scrapy.org/en/latest/topics/selectors.html" rel="noopener noreferrer"&gt;CSS selectors&lt;/a&gt; to extract the data you want from the HTML response received by the HTTP Request node. You can specify the element or attribute you want to extract by entering a CSS selector in the &lt;code&gt;Selector&lt;/code&gt; field.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node: &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.html/?utm_source=n8n_app&amp;amp;utm_medium=node_settings_modal-credential_link&amp;amp;utm_campaign=n8n-nodes-base.htmlExtract#extract-html-content" rel="noopener noreferrer"&gt;HTML&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source Data: JSON&lt;/li&gt;
&lt;li&gt;JSON Property: &lt;code&gt;data&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ve stored the &lt;code&gt;browserHtml&lt;/code&gt; in the &lt;code&gt;data&lt;/code&gt; variable, in the previous &lt;code&gt;Set&lt;/code&gt; node.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extraction Values&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Key: &lt;code&gt;products&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;CSS Selectors: &lt;code&gt;.product-item&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;.product-item&lt;/code&gt; is the main element under which all product details are stored.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Return Value: HTML&lt;/li&gt;
&lt;li&gt;Return Array: Enable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Store the response as HTML in the form of an array.&lt;br&gt;
Post execution, the output should look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4e3so40kd5ex2ji89l9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4e3so40kd5ex2ji89l9q.png" alt="Extract product list using "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can see, we’ve received the HTML data of all products. But what we want is human-readable information, that too individually. &lt;/p&gt;

&lt;p&gt;So let’s separate it out first using the &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.itemlists/#split-out-items" rel="noopener noreferrer"&gt;Item Lists node&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node: &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.itemlists/#split-out-items" rel="noopener noreferrer"&gt;Item List&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Operations: Split Out Items&lt;/li&gt;
&lt;li&gt;Field To Split Out: products&lt;/li&gt;
&lt;li&gt;Include: No Other Fields&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qkexechdh9bqkg0w33d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qkexechdh9bqkg0w33d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4.4 Extracting Individual Products
&lt;/h3&gt;

&lt;p&gt;Alrighty, now that we have got a products field, which contains data of all products in the HTML format. All we need to do is extract the product information using the &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.html/?utm_source=n8n_app&amp;amp;utm_medium=node_settings_modal-credential_link&amp;amp;utm_campaign=n8n-nodes-base.htmlExtract#extract-html-content" rel="noopener noreferrer"&gt;HTML Extract Node&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node: &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.html/?utm_source=n8n_app&amp;amp;utm_medium=node_settings_modal-credential_link&amp;amp;utm_campaign=n8n-nodes-base.htmlExtract#extract-html-content" rel="noopener noreferrer"&gt;HTML Extract Node&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source Data: JSON&lt;/li&gt;
&lt;li&gt;JSON Property: &lt;code&gt;products&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Extraction Values:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Extract Product Name&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Key: &lt;code&gt;name&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;CSS Selector: &lt;code&gt;.product-item-meta__title&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Return Value: Text&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extract Product URL&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Key: &lt;code&gt;url&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS Selector: &lt;code&gt;.product-item-meta__title&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Return Value: Attribute&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Attribute: &lt;code&gt;href&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extract Product Price&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Key: &lt;code&gt;price&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS Selector: &lt;code&gt;.price--highlight&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Return Value: Text&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fba8iioo59up9p8i7hpjz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fba8iioo59up9p8i7hpjz.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After executing the node, it should display the individual product details. &lt;/p&gt;
&lt;h3&gt;
  
  
  4.5 Send Message on Telegram
&lt;/h3&gt;

&lt;p&gt;Phew, that was fun! But hey, there’s more! Time to add a telegram Node to send messages to the Telegram bot we created earlier.&lt;/p&gt;

&lt;p&gt;First of all, add credentials for Telegram API and provide a bot token.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node: Telegram&lt;/li&gt;
&lt;li&gt;Resource: Message&lt;/li&gt;
&lt;li&gt;Operation: Send Message&lt;/li&gt;
&lt;li&gt;Chat ID: Provide the Telegram chat ID we received earlier.&lt;/li&gt;
&lt;li&gt;Text:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{{ $json["name"] }}
https://www.headphonezone.in/{{ $json["url"] }}
{{ $json["price"] }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This text will display a message in this format on Telegram:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TIN HiFi - T5 
https://www.headphonezone.in//products/tin-hifi-t5 
Sale price₹ 9,999
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7l548pxwu9i5cdwojxum.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7l548pxwu9i5cdwojxum.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And voila! If everything worked well, you should be able to receive messages on the Telegram bot. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp3lhiuzpmfc6hdc694c7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp3lhiuzpmfc6hdc694c7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.6 Automate the workflow
&lt;/h3&gt;

&lt;p&gt;Currently, we still need to execute the workflow manually. &lt;/p&gt;

&lt;p&gt;What’s the point of having an automation workflow if it needs a manual trigger? Fortunately, n8n also has a cron node. Let’s add that node to the workflow and remove the start node. &lt;/p&gt;

&lt;p&gt;Here I want to execute this workflow first day of every month at midnight, so this is how the configuration looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node: &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/" rel="noopener noreferrer"&gt;Cron&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Trigger Times:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mode: Every Month&lt;/li&gt;
&lt;li&gt;Hour: 0&lt;/li&gt;
&lt;li&gt;Minute: 0&lt;/li&gt;
&lt;li&gt;Day of the Month:1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfisr01krwpk1l0xr35h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfisr01krwpk1l0xr35h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.6 Activate the workflow
&lt;/h3&gt;

&lt;p&gt;Finally, we’re ready to deploy our workflow. Before that, make sure that you followed all steps of the tutorial, your workflow should look like this. You can activate the workflow from the top right corner of the n8n app and done! Your workflow is now active and will notify you when there’s any offer available.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7uczgfs2xk3v9fkm1fw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7uczgfs2xk3v9fkm1fw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What’s Next?
&lt;/h2&gt;

&lt;p&gt;Our workflow is still hosted on our desktop / local machine. Hence, if your computer is off during the trigger time, then the workflow won’t work and you will miss out on the amazing deals. &lt;/p&gt;

&lt;p&gt;You can check out the n8n cloud to deploy your workflow on the cloud.&lt;/p&gt;

&lt;p&gt;Also, our workflow only scrapes data from the first page of the clearance section. It also needs pagination logic. &lt;/p&gt;

&lt;p&gt;What’s the solution then? &lt;/p&gt;

&lt;p&gt;You can try the &lt;a href="https://www.zyte.com/automated-data-extraction/?utm_campaign=Comt&amp;amp;utm_activity=TPC&amp;amp;utm_medium=ORG&amp;amp;utm_source=3CNT&amp;amp;utm_referrer=Pratik&amp;amp;utm_primary=ZDAPI&amp;amp;utm_secondary=ZAE" rel="noopener noreferrer"&gt;Zyte Auto Extract API&lt;/a&gt;, which takes care of the scraping logic, pagination, and every painful aspect of the scraping. &lt;/p&gt;

&lt;p&gt;Let us know in the comments, if you want us to create another tutorial on that. &lt;/p&gt;

&lt;p&gt;Till then, happy scraping! This is me, &lt;a href="https://www.linkedin.com/in/pratikparmar1/" rel="noopener noreferrer"&gt;Pratik Parmar&lt;/a&gt; signing off.&lt;br&gt;
Over and out!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>api</category>
      <category>scraping</category>
      <category>nocode</category>
    </item>
    <item>
      <title>Win Nintendo Switch and more at Extract Summit Coding Contest</title>
      <dc:creator>Pratik Parmar</dc:creator>
      <pubDate>Fri, 23 Sep 2022 09:04:44 +0000</pubDate>
      <link>https://dev.to/hackyroot/win-nintendo-switch-and-more-at-extract-summit-coding-contest-5ac4</link>
      <guid>https://dev.to/hackyroot/win-nintendo-switch-and-more-at-extract-summit-coding-contest-5ac4</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oDQAg3X3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6v4sokt0a5qw0ylfrdu6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oDQAg3X3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6v4sokt0a5qw0ylfrdu6.gif" alt="Image description" width="880" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hola,&lt;/p&gt;

&lt;p&gt;Do you have what it takes to be called a web scraping whizz?&lt;br&gt;
If so, then we want you. Zyte is hosting the Extract Summit Coding Contest where you get to win prizes like Nintendo Switch, Marshall Wireless headphones and Echo Show!&lt;/p&gt;

&lt;p&gt;All you need to do is crawl and scrape all expected items from a given website and stand a chance to win bragging rights plus awesome prizes. And the best part is it's FREE&lt;br&gt;
Seems exciting? Then register now at:&lt;a href="https://bit.ly/3RS0TZO"&gt;https://bit.ly/3RS0TZO&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
