<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Neha Setia Nagpal on Medium]]></title>
        <description><![CDATA[Stories by Neha Setia Nagpal on Medium]]></description>
        <link>https://medium.com/@cinnamonspecials?source=rss-70fe6b02b559------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qRJhuLdB_9HZeTdX8l1xvA.jpeg</url>
            <title>Stories by Neha Setia Nagpal on Medium</title>
            <link>https://medium.com/@cinnamonspecials?source=rss-70fe6b02b559------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 19:29:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cinnamonspecials/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Next-Gen Scraping: A Deep Dive into Custom AI Scrapy Spiders with Zyte’s AI Tech Stack]]></title>
            <link>https://medium.com/@cinnamonspecials/next-gen-scraping-a-deep-dive-into-custom-ai-scrapy-spiders-with-zytes-ai-tech-stack-3903faa9f2e7?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/3903faa9f2e7</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[scrapy]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[web-scraping-tools]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Fri, 29 Mar 2024 13:34:27 GMT</pubDate>
            <atom:updated>2024-04-23T05:20:49.356Z</atom:updated>
            <content:encoded><![CDATA[<h3>Next-Gen Scraping: A Deep Dive into Custom AI Scrapy Spiders with Zyte’s AI Scraping Tool</h3><h4><strong>Unlocking Precision and Efficiency: A Step-by-Step Guide to Crafting Custom Scrapy Spider Templates for Web Scraping Projects</strong></h4><p>Welcome to the third blog in the series-Understanding and Implementing Scrapy Spider Templates Powered by Zyte’s AI Scraping Tool.</p><p>If you stumble upon this blog first, read the first two blogs of the series-<br>1. <a href="https://medium.com/@cinnamonspecials/a-brief-history-of-the-evolution-of-the-web-scraping-tech-stack-at-zyte-d81a8753a14d">A Brief History of the Evolution of the Web Scraping Tech Stack at Zyte.</a><br>2. <a href="https://medium.com/@cinnamonspecials/ai-web-scraping-revolution-your-guide-to-scraping-30-e-commerce-sites-in-30-minutes-8f674f304940">AI Web Scraping Revolution: Your Guide to Scraping 30 E-Commerce Sites in 30 Minutes</a></p><p>Also, these blogs are supporting articles for the hands-on workshop-<strong>How to Build 30 Scrapy Spiders to scrape product data in under 30 minutes. </strong>You can watch the recording,<a href="https://www.zyte.com/webinars/how-to-build-30-spiders-to-scrape-product-data-in-under-30-minutes/"><strong> here.</strong></a></p><p>In this blog, I will show you how you can customise the open-source Scrapy Spider Templates for your needs.</p><p><strong>Table of Contents</strong></p><ol><li><strong>How does the customisation work?</strong></li><li><strong>Demo website and defining the customisation on this website</strong></li><li><strong>How to customise the metadata and parameters.</strong></li><li><strong>How to customise the product schema- add a new data field to the product schema.</strong></li></ol><h3><strong>How does the customisation work?</strong></h3><p>You can use these spiders however you prefer:</p><ul><li>You can u<a href="https://docs.zyte.com/web-scraping/guides/no-code/index.html#no-code">se them in Scrapy Cloud UI ( which is no code solution)</a></li><li>Or you can start a Scrapy project just like in <a href="https://medium.com/@cinnamonspecials/ai-web-scraping-revolution-your-guide-to-scraping-30-e-commerce-sites-in-30-minutes-8f674f304940">the previous blog</a>.<br>You clone the <a href="https://github.com/zytedata/zyte-spider-templates-project">Zyte Spider Template Project</a> and start data extraction from the URL of your choice, Data will be extracted as per this <a href="https://docs.zyte.com/zyte-data/schemas/product/1.0.html">Product Schema</a>.</li><li>Or you can create your template too by <a href="https://zyte-spider-templates.readthedocs.io/en/latest/setup.html">Extending a Scrapy project</a> (<a href="https://docs.zyte.com/web-scraping/tutorial/extract.html#tutorial-crawling">covered</a> in the <a href="https://docs.zyte.com/web-scraping/tutorial/index.html#tutorial">web scraping tutorial</a>) if you want additional data fields or to change the crawling behaviour, you can do customizations by creating page objects.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*WmMAAE4LHo3-ISYsTdIC6Q.png" /></figure><p>The thumb rule is : <br>1. If you want to customize metadata, parameters, and crawling logic, you do so <a href="https://zyte-spider-templates.readthedocs.io/en/latest/customization/spiders.html"><strong>by subclassing the spider templates.</strong> </a><br>2. If you want to override the parsing logic for all or some websites, both for navigation and item detail data, it is done by <a href="https://zyte-spider-templates.readthedocs.io/en/latest/customization/pages.html#"><strong>customizing the page objects.</strong></a></p><p>Let me show you how :)</p><h3><strong>Demo website and defining the customisation on this website.</strong></h3><p>In this tutorial, I will use <a href="https://ao.com/l/freezers/1/32/">`ao.com`</a>. We will customise the e-commerce template for this website</p><ol><li>by adding new metadata and a new parameter min_price , with which we will only extract the product with a price higher than the min_price.</li><li>by adding a new data field epc rating. In this tutorial, we will extract this rating from the product name.</li></ol><blockquote><strong>For your Curiosity- </strong>An<strong> </strong>EPC rating typically refers to an Energy Performance Certificate, which is a measure used for buildings rather than individual electric appliances. An Energy Performance Certificate assesses the energy efficiency of a building and gives it a rating from A (most efficient) to G (least efficient). The certificate also contains suggestions on ways to improve the building’s energy performance.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNQX_XE5VlsNxCobC1f_4A.png" /></figure><h3><strong>How to customise the metadata and parameters.</strong></h3><ol><li>Create a file named ao.pyunder the spiders folder.</li></ol><pre>from decimal import Decimal<br>from scrapy_poet import DummyResponse<br>from scrapy_spider_metadata import Args<br>from zyte_spider_templates import EcommerceSpider<br>from zyte_spider_templates.spiders.ecommerce import EcommerceSpiderParams<br>from zyte_common_items import Product<br><br>class ao_Params(EcommerceSpiderParams):<br>    min_price: str = &quot;0.00&quot;<br><br>class ao_Custom(EcommerceSpider, Args[ao_Params]):<br>    name = &quot;ao_com&quot;<br>    metadata = {<br>        **EcommerceSpider.metadata,<br>        &quot;title&quot;: &quot;ao.com&quot;,<br>        &quot;description&quot;: &quot;Template for ao.com&quot;,<br>    }<br><br>    def parse_product(self, response: DummyResponse, product: Product):<br>        if Decimal(product.price) &gt;= Decimal(self.args.min_price):<br>            yield product</pre><p>The spider is created using the EcommerceSpider class from the <a href="https://github.com/zytedata/zyte-spider-templates">zyte_spider_templates</a> package and the Product class from the <a href="https://zyte-common-items.readthedocs.io/en/latest/reference/pages.html#zyte_common_items.BaseProductPage">zyte_common_items </a>package. The scrapy-spider-metadata is used for spider and argument management. And, the scrapy-poet is used to support web-poet page objects.</p><p>The code defines two classes:</p><p><strong>ao_Params(</strong>AoComSpiderParams<strong>):</strong> <strong><em>This class inherits from the EcommerceSpiderParams class and defines the minimum price for the products to be extracted</em></strong><em>.</em> The default value is set to 0.00.</p><p><strong>ao_Custom(</strong>AoComSpider<strong>):</strong> <strong><em>This class inherits from the EcommerceSpider and Args classes and is the primary spider class</em></strong><em>.</em> The spider is named `ao_com.py` and provides metadata information about the spider.</p><p>The key functionality of the spider is implemented in the parse_product method, which accepts a response object (a webpage) and a product object (the extracted product data). The method checks if the product’s price is greater than or equal to the minimum price defined in the ao_Params class. If the condition is satisfied, the spider yields the product object for further processing.</p><p>Run the spider with this command in your terminal.</p><pre>scrapy crawl ao_com -a url=&quot;https://ao.com/l/freezers/1/32/&quot; -a min_price=&quot;&lt;enter the min price&gt;&quot; -o output.jsonl</pre><h3><strong>How to customise the product schema- add a new data field to the product schema.</strong></h3><p><strong><em>If you have to add this new field to the data schema or override the data schema, you can do so by implementing Page Objects.</em></strong></p><p><strong><em>What are Page Objects?<br></em></strong><a href="https://martinfowler.com/bliki/PageObject.html"><strong><em>Page Objects were introduced by Martin Fowler</em></strong></a></p><blockquote>When you write tests against a web page, you need to refer to elements within that web page to click links and determine what’s displayed. However, if you write tests that manipulate the HTML elements directly your tests will be brittle to changes in the UI. A page object wraps an HTML page, or fragment, with an application-specific API, allowing you to manipulate page elements without digging around in the HTML.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*P42XUC6nYKi9RdnsFiJk9w.png" /></figure><p>Learn more about Page Objects for Web Data Extraction by joining <a href="https://discord.com/channels/993441606642446397/1223261026393395272">this discussion </a>on <a href="https://discord.gg/B4JyTGMxtm">Extract Data Discord Community.</a></p><ol><li>In `items.py`, paste the following code-<br>This code defines a new class called CustomProduct using the @attrs.define decorator from the attrs library. The CustomProduct the class inherits from the Product class from the zyte_common_items package. The attrs library provides a simple and convenient way to define classes. The CustomProduct class has a single attribute epc (External Product Code) of type str. The Optional type hint indicates that the epc attribute can be None (i.e., it is optional).</li></ol><pre>from typing import Optional<br><br>import attrs<br>from zyte_common_items import Product<br><br><br>@attrs.define<br>class CustomProduct(Product):<br>    epc: Optional[str]</pre><p>2. Under the pages folder create ao.py</p><p><strong><em>pages/ao.py</em></strong></p><p>This code imports the re module from the standard package, the AutoProductPage class from the zyte_common_items package, the CustomProduct class from the local items module, and the handle_urls, Returns, and field functions from the web_poet package.</p><p>The handle_urls decorator is used to define the URL(s) that the crawling should be performed on, in this case, the ao.com domain.</p><p>The AoComPage class inherits from AutoProductPage and Returns[CustomProduct], indicating that it is a web page that returns a CustomProduct an object defined in the items.py`</p><p>The @field decorator is used to define a field on the AoComPage class, which is used to extract data from the web page. In this case, the epc field is defined to extract the epc rating from the product name-name attribute using the re module.</p><p>The AoComPage class does not contain a parse_product method, as it is not required in this case. By inheriting from AutoProductPage, self.product gets automatically filled with a Product instance from Zyte API, and every field not overridden uses that data. In this case, the CustomProduct class is used instead of the Product class, which is specified by the Returns[CustomProduct] type hint. The combination of handle_urls and Returns[CustomProduct] is what makes that, when defining product: CustomProduct in our callback, scrapy-poet knows to use AoComPage to build the requested instance of CustomProduct.</p><p>Overall, this code sets up a Scrapy spider that crawls the ao.com domain and extracts information from web pages, returning CustomProduct objects for each product found. The epc the field is defined to extract the epc rating from the product name-name attribute using the re regular expression module.</p><pre>import re<br>from web_poet import Returns, field, handle_urls<br>from zyte_common_items import AutoProductPage<br><br>from ..items import CustomProduct<br><br>@handle_urls(&quot;ao.com&quot;)<br>class AoComPage(AutoProductPage, Returns[CustomProduct]):<br>    @field<br>    async def epc(self):<br>        match = re.search(r&quot;\b[A-F]\+?\+?(?=[\s-]*[Rr]at(ed|ing)\b)&quot;, self.name)<br>        return match[0] if match else None</pre><p>3. Under the `spiders folder` create ao.py</p><p><strong><em>spiders/ao.py</em></strong></p><pre>from decimal import Decimal<br>from scrapy_poet import DummyResponse<br>from scrapy_spider_metadata import Args<br>from zyte_spider_templates import EcommerceSpider<br>from zyte_spider_templates.spiders.ecommerce import EcommerceSpiderParams<br>from ..items import CustomProduct<br><br>class ao_Params(EcommerceSpiderParams):<br>    min_price: str = &quot;0.00&quot;<br><br>class ao_Custom(EcommerceSpider, Args[ao_Params]):<br>    name = &quot;ao_com&quot;<br>    metadata = {<br>        **EcommerceSpider.metadata,<br>        &quot;title&quot;: &quot;ao.com&quot;,<br>        &quot;description&quot;: &quot;Template for ao.com&quot;,<br>    }<br><br>    def parse_product(self, response: DummyResponse, product: CustomProduct):<br>        if Decimal(product.price) &gt;= Decimal(self.args.min_price):<br>            yield product</pre><p>Run the spider with this command in your terminal.</p><pre>scrapy crawl ao_com -a url=&quot;https://ao.com/l/freezers/1/32/&quot; -a min_price=&quot;&lt;enter the min price&gt;&quot; -o output.jsonl</pre><p>The output will have an additional field ` “epc”: “F”`</p><pre>{&quot;aggregateRating&quot;: {&quot;bestRating&quot;: 5.0, &quot;ratingValue&quot;: 5.0, &quot;reviewCount&quot;: 3}, &quot;availability&quot;: &quot;InStock&quot;, &quot;brand&quot;: {&quot;name&quot;: &quot;CDA&quot;}, &quot;breadcrumbs&quot;: [{&quot;name&quot;: &quot;Home&quot;, &quot;url&quot;: &quot;https://ao.com/&quot;}, {&quot;name&quot;: &quot;Freezers&quot;, &quot;url&quot;: &quot;https://ao.com/l/freezers/1/32/&quot;}, {&quot;name&quot;: &quot;Under Counter Freezer&quot;, &quot;url&quot;: &quot;https://ao.com/l/under_counter_freezer/1/32-35/&quot;}, {&quot;name&quot;: &quot;CDA FW284&quot;}], &quot;currency&quot;: &quot;GBP&quot;, &quot;currencyRaw&quot;: &quot;\u00a3&quot;, &quot;description&quot;: &quot;Delivery From Tue 26th Mar \u25b3From Tue 26th March \u25b3From Tue 26th March \u25b3From Tue 26th March \u25b3 Check delivery dates and prices for your area\n\nServices Connection (\u00a3115), Remove &amp; Recycle (\u00a325), Unpack (\u00a35)\n\nReturns Period 30-day returns&quot;, &quot;descriptionHtml&quot;: &quot;&lt;article&gt;\n\n&lt;p&gt;Delivery\n                    \nFrom Tue 26th Mar \u25b3From Tue 26th March \u25b3From Tue 26th March \u25b3From Tue 26th March \u25b3                    \n                        Check delivery dates and prices for your area&lt;/p&gt;\n\n&lt;p&gt;Services\n                    \n                        Connection (\u00a3115), Remove &amp;amp; Recycle (\u00a325), Unpack (\u00a35)&lt;/p&gt;\n\n&lt;p&gt;Returns Period\n              \n                    \n                        30-day returns&lt;/p&gt;\n\n&lt;/article&gt;&quot;, &quot;mainImage&quot;: {&quot;url&quot;: &quot;https://assets.ao.com/brand-logos/en-GB/cda.png&quot;}, &quot;metadata&quot;: {&quot;dateDownloaded&quot;: &quot;2024-03-21T09:11:03Z&quot;, &quot;probability&quot;: 0.9953565001487732}, &quot;name&quot;: &quot;CDA FW284 Integrated Under Counter Freezer with Sliding Door Fixing Kit - F Rated&quot;, &quot;price&quot;: &quot;379.0&quot;, &quot;regularPrice&quot;: &quot;419.0&quot;, &quot;sku&quot;: &quot;CDA FW284&quot;, &quot;url&quot;: &quot;https://ao.com/product/fw284-cda-under-counter-freezer-white-78207-35.aspx&quot;, &quot;epc&quot;: &quot;F&quot;}</pre><h4>Next</h4><p><a href="https://discord.gg/B4JyTGMxtm"><strong>Join the Extract Data Community</strong></a><strong>- </strong>We’ve established a vibrant Discord community for web scraping enthusiasts like yourself, dedicated to sharing insights, learning new technologies, and advancing in web scraping.</p><p>Ask your queries, and doubts, and share your projects on Discord. Looking forward to seeing you there :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3903faa9f2e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Web Scraping Revolution: Your Guide to Scraping 30 E-Commerce Sites in 30 Minutes]]></title>
            <link>https://medium.com/@cinnamonspecials/ai-web-scraping-revolution-your-guide-to-scraping-30-e-commerce-sites-in-30-minutes-8f674f304940?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f674f304940</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[data-extraction]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[web-scraping-tools]]></category>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Fri, 29 Mar 2024 10:25:48 GMT</pubDate>
            <atom:updated>2024-04-23T05:02:47.413Z</atom:updated>
            <content:encoded><![CDATA[<h4>Discover the Future of Web Scraping: Minimize Code, Maximize Scale, and Surpass ChatGPT’s Speed</h4><p>This article introduces web scraping developers to an innovative and efficient system for constructing large-scale projects with minimal code. <a href="https://www.zyte.com/blog/llm-scaling-web-scraping/"><em>It offers a faster, more cost-effective, and easily scalable alternative to other AI tools and LLMs like ChatGPT.</em></a></p><p>There are multiple AI tools and plenty of articles promising to automate web scraping using AI tools and LLMs like ChatGPT but can you fully automate large-scale web scraping? Here’s a blunt truth!</p><p>Currently, you cannot completely automate large-scale web scraping projects with AI unless you are okay <br><em>1. with sacrificing data quality.<br>2. to give up the entire control of your web data extraction projects to black-box AI solutions, which sometimes hallucinate and when they do, you can’t do anything about them.</em></p><p><strong>You should do neither! And the good news is: you don’t have to with Zyte’s AI Tech Stack for Web Scraping!</strong></p><p>In this article, I will demonstrate a new way of approaching {any}-scale web scraping projects with the Spider Template System using Zyte’s AI Tech Stack without losing control, without compromising the data quality or without the overhead maintenance of managing multiple tools. This system is</p><ul><li><strong><em>Self-healing and resilient towards the website layout changes and antiban upgrades.</em></strong></li><li><strong><em>effortlessly scales to accommodate hundreds or thousands of websites.</em></strong></li></ul><p>The objective of this blog is to demonstrate Zyte’s AI Scraping Tool to scrape product data from various e-commerce websites with a brief introduction to the S<strong>crapy Spider Template System</strong>. But if you want to understand this new system in depth, I recommend reading this blog- <a href="https://medium.com/@cinnamonspecials/a-brief-history-of-the-evolution-of-the-web-scraping-tech-stack-at-zyte-d81a8753a14d"><strong>A Brief History of the Evolution of the Web Scraping Tech Stack at Zyte.</strong></a></p><p>In my view, the best way to proceed with this blog would be to go to the second heading-<strong>How to set up a product data extraction project from 30 e-commerce websites using Zyte’s AI tech stack and Try it :)</strong></p><p>Also, this blog is a supporting article for the hands-on workshop-<strong>How to Build 30 Scrapy Spiders to scrape product data in under 30 minutes. </strong>If you prefer learning through video, You can watch the recording,<a href="https://www.zyte.com/webinars/how-to-build-30-spiders-to-scrape-product-data-in-under-30-minutes/"><strong> here.</strong></a></p><h4>Table of contents</h4><ol><li><strong>Introduction to Zyte’s AI tech stack and Scrapy spider template system for web scraping.</strong></li><li><strong>Setting up a product data extraction project from 30 e-commerce websites using Zyte’s AI tech stack.</strong></li><li><strong>Surprise!</strong></li><li><strong>Conclusion.</strong></li><li><strong>Next Steps- Tailoring the Solution: Customization Possibilities and Implementation Guide For Spider Templates.</strong></li></ol><h3>Introduction to Zyte’s AI tech stack and scrapy spider template system for web scraping.</h3><p>Zyte’s AI tech stack combines Scrapy, Zyte API with AI capabilities, and Scrapy Cloud into a predefined Scrapy Spider Template(currently only available for product data). This template simplifies and automates the traditional complexities of a web scraping project. <br><br>Smart Spider Templates equip you to scrape websites rapidly and build self-healing spiders that adapt to changes without writing the crawling logic or Xpath/CSS selectors. These templates have no limitations and allow for extensive customization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FaCixD3GQhaEzZHO.png" /></figure><ol><li><strong>Scrapy Spider Templates </strong><br><a href="https://github.com/zytedata/zyte-spider-templates">zyte-spider-templates</a>: This library contains Scrapy spider templates or automatic crawlers. They can be used out of the box with the Zyte features such as Zyte API or modified to be used standalone. The AI-powered Spider Templates automate and streamline the web scraping process. They enable quick and easy setup by automatically recognizing navigation patterns and handling pagination. Whatever you can achieve with Scrapy, you can accomplish within a template, including altering crawling patterns, filtering results, adding arguments, processing data, and exporting it.<br><br><a href="https://github.com/zytedata/zyte-spider-templates-project">zyte-spider-templates-project</a> : This is a starting template for a Scrapy project, with built-in integration with Zyte technologies (scrapy-zyte-api, zyte-spider-templates). We will use this template in the project.</li><li><strong><em>Self-Healing AI capabilities of the Spider template system :</em> </strong><br><strong>Crawling<br></strong>Zyte API’s AI capabilities eliminate the burden of writing and maintaining custom crawling code for each website, enabling scalability. The AI is trained to recognize both common and uncommon navigation patterns, relieving developers from the task of figuring out site navigation, URL structures, and pagination. It works out of the box and can be easily customized using Python Scrapy code if desired. Zyte’s Automated ban management is another benefit of AI crawling. The system automatically avoids bans by utilizing the minimum infrastructure required.<br><strong>Extraction</strong><br>AI also solves the challenge of parsing and extracting data by learning to read pages like a human in real-time. It autonomously finds the required data without explicit instructions, making the process fast and immune to site changes. By providing an e-commerce page URL, the AI delivers product details in a legally compliant schema, which can be further extended with manual rules if desired.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*FQNbDFTxkow1KNFQLsG7SQ.png" /></figure><p>So, how does the template system work? Let’s understand through this small project.</p><h3>Prerequisites</h3><ol><li>Sign up for <a href="https://app.zyte.com/account/signup/ai-scraping?utm_primary=AIscraping&amp;utm_campaign[%E2%80%A6]ignup&amp;utm_activity=ORS&amp;utm_medium=community&amp;utm_source=discord">Zyte’s AI Scraping Tool</a>, here</li><li>Take a note of Zyte_API_Key.</li><li>Understanding of Scrapy</li></ol><h3>Setting up a product data extraction project from 30 e-commerce websites using Zyte’s AI Tech Stack.</h3><p>You can also download the entire code here. {insert a github}</p><p>But here’s a step-by-step guide to running the e-commerce spider template</p><ol><li>Open the terminal and clone the <a href="https://github.com/zytedata/zyte-spider-templates-project">zyte-spider-templates-project</a> :</li></ol><pre>git clone <a href="https://github.com/zytedata/zyte-spider-templates-project">https://github.com/zytedata/zyte-spider-templates-project</a></pre><p>2. Rename the zyte_spider_templates_project folder to a valid Python module name (e.g. use _ instead of - or spaces).</p><p>3. cd &lt;your-project-name&gt;</p><p>4. update these files with your project name.</p><ul><li>scrapy.cfg</li><li>settings.py<br>BOT_NAME, SPIDER_MODULE, NEWSPIDER_MODULE, SCRAPY_POET_DISCOVER</li></ul><p>5. Add in settings.py `ZYTE_API_KEY`</p><p>6. Remove or replace the LICENSE and README.rst files.</p><p>7. Delete .git, and start a fresh Git repository:</p><pre>rm -rf .git<br>git init<br>git add -A<br>git status<br>git commit -m &quot;Initial commit&quot;</pre><p>8. Create a Python virtual environment and install requirements.txt into it:</p><pre>python3 -m venv venv<br>. venv/bin/activate<br>pip install -r requirements.txt</pre><p>9. You can now run the e-commerce spider with a URL of your choice.</p><pre>scrapy crawl ecommerce -a url=&quot;&lt;enter the url &gt;&quot;</pre><p>10. <strong>Time to Set up 30 e-commerce spiders.</strong></p><p>Create two files- domains.txt and run30sites.py and paste the following code into the respective files.<br>The code in the run30sites.py reads URLs from the domain.txt(containing 30 different e-commerce domain URLs) and runs a scrapy e-commerce template spider.</p><p><strong>domain.txt</strong></p><pre>wayfair.ca<br>kleinanzeigen.de<br>lowes.com<br>tesco.com<br>shein.com<br>allegro.pl<br>lowes.com<br>adidas.com<br>otto.de<br>idealo.de<br>homedepot.com<br>xxxlutz.at<br>kroger.com<br>ubereats.com<br>direct.leaseplan.co.uk<br>target.com<br>farfetch.com<br>shein.co.uk<br>leroymerlin.fr<br>tesco.ie<br>xxxlutz.ch<br>wayfair.com<br>118118.com<br>kick.com<br>justeat.com<br>sainsburys.co.uk<br>dba.dk<br>shopee.sg<br>rappi.com.br<br>myvue.com<br>ubereats.com<br>doordash.com<br>cars.com<br>finde-offen.de<br>tori.fi<br>grubhub.com<br></pre><p><strong>run30sites.py</strong></p><pre>import subprocess<br>import os<br><br>def main():<br>    processes = []<br>    os.makedirs(&quot;output&quot;,exist_ok=False)<br>    with open(&quot;domains.txt&quot;) as input_file:<br>        for domain in input_file:<br>            domain = domain.strip()<br>            processes.append(<br>                subprocess.Popen(<br>                    [<br>                        &quot;scrapy&quot;, <br>                        &quot;crawl&quot;,<br>                        &quot;ecommerce&quot;,<br>                        &quot;-a&quot;,<br>                        &quot;max_requests=50&quot;,<br>                        &quot;-a&quot;,<br>                        f&quot;url=https://{domain}/&quot;,<br>                        &quot;-o&quot;,<br>                        f&quot;output/{domain}.jsonl&quot;,<br>                    ]<br>                )<br>            )<br>    for process in processes:<br>        process.wait()<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p><strong>How to scale this project to hundreds or thousands of e-commerce websites.</strong><br>With the provided code, you can effortlessly set up an impressive number of spiders — <strong>whether it’s 30, 100, or even 1000 — in just 10 minutes(Just add the URLs in </strong>`domain.txt`). The speed, quality and efficiency of this process are truly remarkable, enabling you to enhance your productivity in web scraping tasks.</p><p>This code empowers developers to save valuable time and swiftly deploy spiders for extracting product data from various sources. The streamlined spider creation process and faster development cycles make it an exhilarating tool to work with.</p><h3>Conclusion</h3><p>Zyte’s mission is to connect data enthusiasts with quality reliable web data at any scale without coding hassles, getting banned or breaking spiders.</p><p>With this Spider Template System supercharged with Zyte’s AI Stack, Zyte is one more step closer to fulfilling its mission. Of course, we won’t stop inventing and optimising, so stay tuned :P</p><p><strong><em>Get ready to revolutionize your web scraping endeavours with Zyte’s AI Scraping Tool, and let us know what you think about this new approach to web scraping projects or reach out to us if you need coding help on our discord- </em></strong><a href="https://discord.gg/B4JyTGMxtm"><strong><em>Join and connect with 1000s of industry leaders on Extract Data Community!</em></strong></a></p><p>Happy Scraping and Love to all :) <br>Neha, Developer Advocate, Zyte</p><p><strong>Read the Next Blog- </strong><a href="https://medium.com/p/3903faa9f2e7/edit"><strong>Tailoring the Solution: Customization Possibilities and Implementation Guide For Spider Templates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f674f304940" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief History of the Evolution of the Web Scraping Tools at Zyte.]]></title>
            <link>https://medium.com/@cinnamonspecials/a-brief-history-of-the-evolution-of-the-web-scraping-tech-stack-at-zyte-d81a8753a14d?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/d81a8753a14d</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[scrapy]]></category>
            <category><![CDATA[data-extraction]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[web-scraping-tools]]></category>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Fri, 29 Mar 2024 10:21:21 GMT</pubDate>
            <atom:updated>2024-03-29T13:54:46.163Z</atom:updated>
            <content:encoded><![CDATA[<p>Before you move, this is the first part of the blog series-understanding and Implementing Scrapy Spider Templates Powered by Zyte’s AI Scraping Tool.<br>Also, these Blogs are supporting articles for the hands-on workshop-<strong>How to Build 30 Scrapy Spiders to scrape product data in under 30 minutes. </strong>If you prefer learning through video, You can watch the recording,<a href="https://www.zyte.com/webinars/how-to-build-30-spiders-to-scrape-product-data-in-under-30-minutes/"><strong> here.</strong></a></p><blockquote><strong>If you truly want to understand the present or yourself, you must begin in the past. You see, history is not simply the study of the past. It is an explanation of the present — Paul Hunham from the movie- The Holdovers.</strong></blockquote><p>Let me tell you the story of a developer named Lucas. Lucas has approximately ten years of experience in the web scraping industry. He broadly went through three broad phases in his entire web scraping experience namely- the manual phase, the automation phase, and the optimisation phase.</p><p>If I divide this evolution into three broad phases-:</p><ol><li><strong>The Manual Phase using Scrapy</strong><br>In this phase, Lucas diligently wrote every line of code for web scraping projects. This included crafting the crawling logic, implementing rotating proxy solutions, and utilizing browser automation tools like Splash, Puppeteer, and Selenium. Lucas also had to invest time in researching and manually upgrading the solution to tackle advanced antiban software.<br>However, this manual approach posed numerous challenges. Writing the spiders alone consumed several days of work, not to mention the additional time required to write the crawling code, selectors, and unblock bans. Moreover, the constant need to adjust both selectors and bans whenever the website layout or anti-bot measures changed added to the complexity. The arduous process of creating site-specific code and integrating multiple tools not only made scaling difficult but also increased costs and maintenance overhead.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*IV8-XQGLTx06uCWTwjvScg.png" /></figure><ol><li><strong>The Automation Phase using Scrapy and Zyte API </strong><br>Lucas experienced a significant reduction in workload thanks to the integration of Zyte API into the web scraping system. With Zyte API automatically handling bans, proxy management, and supporting browser automation through its actions capability, Lucas was able to focus primarily on writing the crawling and extraction logic using scrapy spiders. This eliminated the need for configuring the spider to avoid bans or managing rotating proxies, resulting in streamlined operations.<br>Furthermore, integrating Zyte API into the system eliminated the need for multiple tools, reducing maintenance overhead and improving monitoring capabilities. However, despite these advancements, challenges remained. <br>Writing spiders manually still posed a hurdle, and hence, scaling the system proved to be difficult. While the system was equipped to self-heal in terms of antiban software upgrades, it lacked the adaptability to seamlessly handle website layout changes.</li></ol><ul><li><strong>The Automation Phase uses Scrapy and Zyte API with AI-powered extraction.</strong><br>With the integration of patented machine learning into Zyte API, Lucas could now enjoy a range of benefits. The system offers supervised machine learning that surpasses the performance of large language models in terms of speed, accuracy, and cost-effectiveness. The high accuracy of the system is further enhanced by the ‘quick fixes’ process, where the support team applies specialized hints for optimizing the model on a per-site basis.<br>Moreover, the economical nature of running the system on every page at runtime makes it self-healing when website layouts change, which means no more writing selectors manually. Hence, effectively addressing the maintenance challenges. <br>Additionally, the system provides compliance confidence out of the box by employing standard schemas that automatically exclude sensitive data such as personally identifiable information (PII) and copyrighted content. These features ensure that Lucas can extract data quickly, accurately, and in a compliant manner.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*PORa7SlX6VRPP1Vv9K90UQ.png" /></figure><p><strong>The Optimisation Phase using the Scrapy Spider Template System composed of Zyte AI Stack-Scrapy + Zyte API (with AI-powered extraction capabilities)</strong></p><p>During the Optimization Phase, Lucas leverages the Scrapy Spider Template System powered by the Zyte AI Stack, which combines Scrapy and Zyte API with AI-powered extraction capabilities. This integrated template system revolutionizes the web scraping process for Lucas.</p><p>With the template system, Lucas no longer needs to write spiders, and selectors, or manually configure them for bans, site upgrades, or proxy management. Instead, Lucas runs the template using the command<br> &quot;Scrapy crawl ecommerce url=&#39;enter your URL&#39;&quot;<br> to effortlessly extract product data. The template eliminates the need for manual coding and streamlines the entire data extraction process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*FQNbDFTxkow1KNFQLsG7SQ.png" /></figure><p><strong>Next Steps</strong></p><ol><li><a href="https://app.zyte.com/account/signup/ai-scraping?utm_primary=AIscraping&amp;utm_campaign[%E2%80%A6]ignup&amp;utm_activity=ORS&amp;utm_medium=community&amp;utm_source=discord"><strong>Sign up for AI For Web Scraping</strong></a><strong>- </strong>Try it and Let us know what you think on <a href="https://discord.gg/B4JyTGMxtm">Extract Data Discord.</a></li><li><strong>Read the Next Blog in the Series- </strong><a href="https://medium.com/p/8f674f304940/edit"><strong>AI web scraping-web scraping product data from 30 e-commerce websites in under 30 minutes</strong></a></li><li><a href="https://discord.gg/B4JyTGMxtm">Join the Extract Data Community</a>- We’ve established a vibrant Discord community for web scraping enthusiasts like yourself, dedicated to sharing insights, learning new technologies, and advancing in web scraping. I am looking forward to seeing you there :)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*mh2bfzg8Y0-xD9OalXfhcg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d81a8753a14d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Zyte SmartProxy Selenium library?]]></title>
            <link>https://medium.com/@cinnamonspecials/what-is-zyte-smartproxy-selenium-library-db304c8c0904?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/db304c8c0904</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Wed, 15 Jun 2022 01:30:00 GMT</pubDate>
            <atom:updated>2022-06-15T01:30:00.496Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introducing a new, easy-to-use library to work with Zyte Smart Proxy Manager</h4><p>Zyte SmartProxy Selenium library is a client library built on top of <a href="https://www.selenium.dev/">Selenium</a> — an open-source framework for web automation across Chromium, Firefox, and WebKit, with a single API, written to work seamlessly with Zyte Smart Proxy Manager.</p><p>With this library, you will be able to make the best of the headless browser capabilities of Selenium and manage bans by unlocking the powerful proxy management tool — Zyte Smart Proxy Manager in your web scraping projects.</p><p>Read the detailed Blog on <a href="https://www.zyte.com/blog/how-to-use-selenium-with-zyte-smart-proxy-manager/">how to integrate selenium with Zyte Smart Proxy Manager</a></p><p>I will be hosting a webinar on the <strong>22nd of June</strong>, to demonstrate the true power of this new integration. This webinar will be a good opportunity for you to interact with our web scraping experts and clarify your doubts on the fly.</p><p><a href="https://www.zyte.com/webinars/zyte-smart-proxy-manager-with-headless-browsers/">Register here</a>!</p><p>#selenium #webscraping #webautomation #headlessbrowser #dataextraction #zyte</p><p><em>Read this post and more on my </em><a href="https://typeshare.co/nehasetianagpal/posts/what-is-zyte-smartproxy-selenium-library-"><em>Typeshare Social Blog</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db304c8c0904" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Zyte SmartProxy Puppeteer library?]]></title>
            <link>https://medium.com/@cinnamonspecials/what-is-zyte-smartproxy-puppeteer-library-149a5a2fea04?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/149a5a2fea04</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 12:30:02 GMT</pubDate>
            <atom:updated>2022-06-14T12:30:02.057Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introducing a new, easy-to-use library to work with Zyte Smart Proxy Manager</strong></p><p>Zyte SmartProxy Puppeteer library is a client library built on top of <a href="https://developers.google.com/web/tools/puppeteer">Puppeteer</a> — a high-level API to control headless chrome, written to work seamlessly with Zyte Smart Proxy Manager.</p><p>With this library, you will be able to make the best of the headless browser capabilities of Puppeteer and manage bans by unlocking the powerful proxy management tool — Zyte Smart Proxy Manager in your web scraping projects.</p><p>Read the detailed blog on<a href="https://www.zyte.com/blog/how-to-use-puppeteer-with-zyte-smart-proxy-manager/"> How to use Playwright with Zyte Smart Proxy Manager.</a></p><p>Also, will be hosting a webinar on the <strong>22nd of June</strong>, to demonstrate the true power of this new integration. This webinar will be a good opportunity for you to interact with our web scraping experts and clarify your doubts on the fly.</p><p>Don’t forget to<a href="https://www.zyte.com/webinars/zyte-smart-proxy-manager-with-headless-browsers/"> Register here!</a></p><p>#puppeteer #webscraping #webautomation #headlessbrowser #dataextraction #zyte</p><p><em>Read this post and more on my </em><a href="https://typeshare.co/nehasetianagpal/posts/what-is-zyte-smartproxy-puppeteer-library-lfbf"><em>Typeshare Social Blog</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=149a5a2fea04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Zyte SmartProxy Playwright library?]]></title>
            <link>https://medium.com/@cinnamonspecials/what-is-zyte-smartproxy-playwright-library-64a13b497f70?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/64a13b497f70</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 09:32:05 GMT</pubDate>
            <atom:updated>2022-06-14T12:32:59.882Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introducing a new, easy-to-use library to work with Zyte Smart Proxy Manager</h4><p>Zyte SmartProxy Playwright library is a client library built on top of <a href="https://www.npmjs.com/package/playwright">Playwright</a> — an open-source framework for web automation across Chromium, Firefox, and WebKit, with a single API, written to work seamlessly with Zyte Smart Proxy Manager.</p><p>With this library, you will be able to make the best of the headless browser capabilities of Playwright and manage bans by unlocking the powerful proxy management tool — Zyte Smart Proxy Manager in your web scraping projects.</p><p>Read the detailed blog on <a href="https://www.zyte.com/blog/how-to-use-playwright-with-zyte-smart-proxy-manager/">How to use Playwright with Zyte Smart Proxy Manager</a>.</p><p>Also, will be hosting a webinar on the <strong>22nd of June</strong>, to demonstrate the true power of this new integration. This webinar will be a good opportunity for you to interact with our web scraping experts and clarify your doubts on the fly.</p><p>Don’t forget to Register <a href="https://www.zyte.com/webinars/zyte-smart-proxy-manager-with-headless-browsers/">here!</a></p><p>#playwright #webscraping #webautomation #headlessbrowser #dataextraction #zyte</p><p><em>Read this post and more on my </em><a href="https://typeshare.co/nehasetianagpal/posts/what-is-zyte-smartproxy-playwright-library-ymkt"><em>Typeshare Social Blog</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64a13b497f70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[unable to troubleshoot why you are getting blocked while scraping a website?]]></title>
            <link>https://medium.com/@cinnamonspecials/unable-to-troubleshoot-why-you-are-getting-blocked-while-scraping-a-website-b30a435be451?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/b30a435be451</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 11:01:41 GMT</pubDate>
            <atom:updated>2023-03-28T16:04:20.654Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to the part two of the Anti-bot mechanisms series-Browser Fingerprinting 101.</p><p>Just like your fingerprints uniquely identify you, your Digital Fingerprint- A collection of various parameters attribute to your unique identity on the web. This information is then used by the websites to know your preferences and interests on the web.</p><p>A rule of thumb to master the art of crawling is to avoid being identified as a bot or standing out from the crowd, which implies train your spiders to behave like a human. If website identify you as a bot, they might block you. How do you make sure you leave a real-user like fingerprint and not a spider’s?</p><p><strong>To answer, let’s dive deep into browser fingerprinting.</strong></p><blockquote>The state of the art websites interact with users and render graphics through javascript. To render javascript elements, the websites call the browser APIs. While doing so they inject fingerprinting scripts which look just like any other script running on a website. These scripts collect the attributes — device specifications, OS, browser settings and plug-ins, user agents, audio and video capabilities, timezone, <strong>language, screen resolution </strong>and more — that can be compiled into a browser fingerprint.</blockquote><p>To know more about what information does a website gather through browser fingerprinting or to test Your browser’s fingerprinting?</p><p>Check this website, <a href="https://amiunique.org/">https://amiunique.org/</a></p><p><strong>Here are some of the advanced techniques for the browser fingerprinting</strong></p><ul><li>Canvas fingerprinting.</li><li>WebGL fingerprinting and rendering fingerprinting.</li><li>Device fingerprinting.</li><li>Audio fingerprinting.</li></ul><h3><strong>So, how to look like a human while crawling?</strong></h3><blockquote>While we cannot delete browser fingerprint or block javascript as the website will break. What we can do is confuse the fingerprinting scripts. The trick is to blend-in with the crowd by masking and modifying your identity.</blockquote><p>Masking and modifying refer to manipulating your unique attributes and. changing them periodically so that your fingerprint is constantly changing and you can’t be reliably identified. You can do so by</p><ol><li><strong>rotating proxies.</strong></li><li><strong>rotating user-agents.</strong></li></ol><p>Read more about rotating proxies on this <a href="https://www.zyte.com/blog/why-are-rotating-proxies-important/?utm_campaign=DUK&amp;utm_activity=ORS&amp;utm_medium=SOC&amp;utm_source=TWI&amp;utm_content=rot_pro&amp;utm_primary=SPM&amp;utm_goal=SIN">blog</a> and user-agent on this <a href="https://twitter.com/nehasetianagpal/status/1516384833404125188?s=20&amp;t=pJGE49lP_-soqQgO5v3Lug">Twitter thread</a>.</p><p>3.<strong> Invest in a Tool that does it for you- Introducing Zyte API</strong></p><p>Zyte API is an all-in-one solution for reliable web data extraction, providing the necessary tools to extract data from any website with the leanest setup and at the lowest cost. It uses state-of-the-art techniques to counter virtually every anti-scraping method in use, making it a genuine breakthrough for data scientists and professionals.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjCqTYLhXF7I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjCqTYLhXF7I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjCqTYLhXF7I%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ca47cb3b9885dc2544baf3e2f5e8bf4/href">https://medium.com/media/7ca47cb3b9885dc2544baf3e2f5e8bf4/href</a></iframe><blockquote><strong>Zyte API is a powerful API that consolidates virtually every known web scraping technology and technique into a simple, yet powerful API to collect web data at scale. It automatically adapts to any site changes, ensuring users are never banned and always get their data even if the target site changes its code. The solution saves money and reduces valuable developer hours on maintenance and tasks better suited to algorithms and specialist API developers.</strong></blockquote><h3>How do I start?</h3><ol><li><a href="https://www.zyte.com/zyte-api/?utm_campaign=Comt&amp;utm_activity=EVT&amp;utm_source=EVT&amp;utm_referrer=Neha&amp;utm_primary=ZDAPI&amp;utm_secondary=ZDAPI&amp;utm_goal=SIN">Sign up here</a> and get <a href="https://docs.zyte.com/zyte-api/get-started/pricing.html#zyte-api-trial">$5 in free credits</a>.</li><li><a href="https://docs.zyte.com/zyte-api/get-started/dash.html#zyte-api-extract-web">Use your web browser</a> to send your first request to a website so you check what the <a href="https://docs.zyte.com/zyte-api/get-started/pricing.html#zyte-api-pricing">cost</a> is.</li><li>Follow the <a href="https://docs.zyte.com/zyte-api/get-started/tutorial/index.html#zyte-api-tutorial">Zyte API tutorial</a> to learn how to get more data.</li></ol><p>Check out <a href="https://docs.zyte.com/zyte-api/usage/extract/index.html"><strong>Zyte API tutorial</strong></a><strong> </strong>and get started in minutes.</p><p>#antibot #anitban #webscraping #webcrawling #digitalfingerprinting #browserfingerprinting</p><p><em>Read this post and more on my </em><a href="https://typeshare.co/nehasetianagpal/posts/unable-to-troubleshoot-why-you-are-getting-blocked-while-scraping-a-website-g4a8"><em>Typeshare Social Blog</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b30a435be451" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you experiencing `403 Forbidden` while crawling? This could be one of the reasons…]]></title>
            <link>https://medium.com/@cinnamonspecials/are-you-experiencing-403-forbidden-while-crawling-this-could-be-one-of-the-reasons-4ae0b3b4fe4d?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ae0b3b4fe4d</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Tue, 19 Apr 2022 11:44:04 GMT</pubDate>
            <atom:updated>2023-07-12T07:45:36.510Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to the part one of the Anti-bot mechanisms series…</p><p>Are you experiencing 403 Forbidden status code while crawling a website? Well, It indicates that the server understands the request but refuses to authorise it. Here’s one of the reasons you might be experiencing it.</p><p>Introducing request headers…</p><p>When it comes to food, everyone has a different palate. That’s the reason why people pass on additional information about their preferences when ordering online. Request Headers are no different when you request a website from your browser. They provide added information about the website requested by the user so the server can tailor the response accordingly. To view the request header in your browser, follow this<a href="https://stackoverflow.com/questions/4423061/how-can-i-view-http-headers-in-google-chrome"> tutorial</a>.</p><p>The following fields are consistently used by most major browsers when initiating any connection:</p><ul><li>Host request header specifies the host and port number of the server to which the request is being sent.</li><li>Connection controls whether the network connection stays open after the current transaction finishes. For example, Connection: keep-alive, the value keep-alive indicates that the client would like to keep the connection open for the subsequent requests.</li><li>Accept is used to specify which media types, the client is able to understand. For example, Accept: text/html, Accept: image/*</li><li>Accept-Encoding indicates the content encoding (usually a compression algorithm) that the client can understand. For example, Accept-Encoding: gzip, Accept-Encoding: compress</li><li>Accept-Language indicates the natural language and locale that the client prefers. For example: Accept-Language: en-US</li><li>User-Agent represents you by telling the server about your application, operating system, vendor, and/or version. For example:</li><li>user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36</li><li>Without user agents, a web server would serve the same content to all website visitors. However, with the information contained in a user agent, a web server can custom-tailor the content for every visitor.</li></ul><p><strong>But What is the Role of Request Headers in Web Scraping?</strong></p><p>Typically, the only field that matters in web scraping is User-Agents. The sole purpose of a scraping project is to crawl a website politely without being identified as a bot. To ensure you are a human, the website inspects the user-agents field.</p><p>Scraping Bots take the default value for the user-agent set by the python library making the request. For example, urllib the library will set UA as Python-urllib/3.4. With the default UA value, the website identifies you as a bot and blocks you. The trick is to set this value human-like.</p><p><strong>So, How To Behave Human-like With User-Agents?</strong></p><ol><li><strong><em>Use quality user-agents<br></em></strong>Stick to user agents that match the browser you’re using for scraping to make them match the default behaviour of this browser. One of the many ways to set the user-agent is using Request Library. It allows complete customisation of the HTTP headers.</li><li><strong><em>Rotate user-agents</em></strong><br>Rotate User-agents to make the server believe the requests are from different users. If you use the same user-agent for multiple requests, you will be blocked. You can perform user-agent rotation in Python and Selenium. If using scrapy, you can use `scrapy-useragents` middleware.</li></ol><p><strong>Pro-tip</strong></p><p>If you ever encounter an extremely suspicious website, populating one of the commonly used but rarely checked headers such as Accept-Language might be the key to convincing it you’re a human.</p><p>To conclude, one of the many things on the checklist for seamless crawling is to make sure you are choosing reputed user-agents and keep rotating them. If you don’t want to do it yourself, look for an all in one solution like <a href="https://medium.com/u/4d3a276154a2">Zyte (formerly Scrapinghub)</a>’s Zyte API that automatically adjust all these parameters according to the website.</p><h3>How do I start?</h3><ol><li><a href="https://www.zyte.com/zyte-api/?utm_campaign=Comt&amp;utm_activity=EVT&amp;utm_source=EVT&amp;utm_referrer=Neha&amp;utm_primary=ZDAPI&amp;utm_secondary=ZDAPI&amp;utm_goal=SIN">Sign up here</a> and get <a href="https://docs.zyte.com/zyte-api/get-started/pricing.html#zyte-api-trial">$5 in free credits</a>.</li><li><a href="https://docs.zyte.com/zyte-api/get-started/dash.html#zyte-api-extract-web">Use your web browser</a> to send your first request to a website so you check what the <a href="https://docs.zyte.com/zyte-api/get-started/pricing.html#zyte-api-pricing">cost</a> is.</li><li>Follow the <a href="https://docs.zyte.com/zyte-api/get-started/tutorial/index.html#zyte-api-tutorial">Zyte API tutorial</a> to learn how to get more data.</li></ol><p>Check out <a href="https://docs.zyte.com/zyte-api/usage/extract/index.html"><strong>Zyte API tutorial</strong></a><strong> </strong>and get started in minutes.</p><p><em>#webscraping #antiban #403 #useragents #scrapyuseragents #scrapy #webcrawling</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ae0b3b4fe4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s go headless…]]></title>
            <link>https://medium.com/@cinnamonspecials/lets-go-headless-658fea52fd2d?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/658fea52fd2d</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 08:29:08 GMT</pubDate>
            <atom:updated>2024-05-20T04:39:12.620Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you trying to scrape dynamic data, nested in javascript elements or ajax pages, which is not accessible from the raw HTML response that the server delivers?</p><p>Consider integrating a headless browser with the scraping logic…headless? Wait, What? but why?</p><p>Let me explain…</p><p>Websites have moved on from static HTML and CSS barebone structures to interactive and responsive Javascript structures that are rendered by browsers to dynamically inject HTML and CSS into websites when demanded.</p><p>Regular HTML scrapers do not include functionality to render the page full of ajax and javascript elements like a real user in an automated web scraping. Introducing Headless Browser…</p><p>A headless browser is a browser with no Graphical User Interface(GUI).</p><p>Headless browsers exhibit human-like behavior in an automated task to scrape the required data embedded in javascript elements without the additional overhead of loading and processing visual elements of a website. They are controlled programmatically using command-line tools.</p><p>There are many web scraping tools that can be used for headless browsing. The most popular ones are Puppeteer, Selenium, and Playwright. Let’s talk about Puppeteer…</p><p>Puppeteer is a Node.js library that supports controlling headless Chrome and Firefox. It allows downloading data, using proxies, and more. The library is maintained by the Chrome DevTools team with an active open-source community which is why Puppeteer has become one of the most popular options. For this reason, @zytedata has been working on the Zyte SmartProxy Puppeteer library to work in conjunction with the Smart Proxy Manager to crawl javascript-heavy websites with ease.</p><p>Zyte SmartProxy Puppeteer library is a client library built on top of Puppeteer — a high-level API to control headless chrome, written to work seamlessly with Smart Proxy Manager.</p><p>With Zyte SmartProxy Puppeteer library, there is</p><ul><li>No need to manage an additional headless-proxy tool running in the background.</li><li>No need to run a separate piece of software to connect Puppeteer with Smart Proxy Manager</li></ul><p>Resources:</p><p>The library is open-source and available here:</p><p><a href="https://github.com/zytedata/zyte-smartproxy-puppeteer">GitHub - zytedata/zyte-smartproxy-puppeteer: A wrapper over Puppeteer to provide Zyte Smart Proxy Manager specific functionalities.</a></p><p>To use Smart Proxy Manager, Sign up for a 14-day free trial.</p><p><a href="https://www.zyte.com/smart-proxy-manager/">Automated Rotating Proxy Solution | Smart Proxy Management | Zyte</a></p><p>and follow this hands-on tutorial to integrate Smart proxy Manager with puppeteer</p><p><a href="https://docs.zyte.com/smart-proxy-manager/integrations/puppeteer.html">Using Smart Proxy Manager with Puppeteer - Zyte documentation</a></p><p><em>Read this post and more on my </em><a href="https://typeshare.co/nehasetianagpal/posts/lets-go-headless--h5ov"><em>Typeshare Social Blog</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=658fea52fd2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deciding the perfect proxy management and anti-ban solution for large scale web scraping projects?]]></title>
            <link>https://medium.com/@cinnamonspecials/deciding-the-perfect-proxy-management-and-anti-ban-solution-for-large-scale-web-scraping-projects-a3a947304be5?source=rss-70fe6b02b559------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3a947304be5</guid>
            <dc:creator><![CDATA[Neha Setia Nagpal]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 12:38:17 GMT</pubDate>
            <atom:updated>2023-07-12T07:16:53.525Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are 7 things to keep in mind.</p><p>Check if it can …</p><ul><li>Detect different types of bans so that you can troubleshoot and fix the underlying problem — i.e. captchas, redirects, blocks, cloaking, etc.</li><li><strong>Retry errors</strong> and timeouts with different proxies.</li><li>Manage <strong>Request headers</strong> by rotating user agents.</li><li><strong>Manage sessions and </strong>Cookies.</li><li>configure <strong>geographical targeting</strong> for proxies.</li><li>Automatically randomise delays and change request throttling based on the real-time feedback.</li><li>works well with the chosen headless browser libraries to scrape dynamic websites seamlessly.</li></ul><p>Introducing <a href="https://app.zyte.com/account/signup/zyteapi?_gl=1*1vdaw88*_ga*MTE4MTIxMzU4NC4xNjgwMDE5MjUx*_ga_PC3KF6FQ4T*MTY4OTE0NDg3NC40MDQuMS4xNjg5MTQ1NzI0LjE3LjAuMA..#_gl=1*1ae6ehs*_gcl_au*MTY0Mjc1NDgzNy4xNjgxODg5NjUz">Zyte API</a> that does all of the above so you can focus on extracting quality data at large scale .</p><h3>How to start?</h3><ol><li><a href="https://docs.zyte.com/zyte-api/get-started/sign-up.html#zyte-api-sign-up">Sign up here </a>and get <a href="https://docs.zyte.com/zyte-api/get-started/pricing.html#zyte-api-trial">$5 in free credits</a>.</li><li><a href="https://docs.zyte.com/zyte-api/get-started/dash.html#zyte-api-extract-web">Use your web browser</a> to send your first request to a website so you check what the <a href="https://docs.zyte.com/zyte-api/get-started/pricing.html#zyte-api-pricing">cost</a> is.</li><li>Follow the <a href="https://docs.zyte.com/zyte-api/get-started/tutorial/index.html#zyte-api-tutorial">Zyte API tutorial</a> to learn how to get more data.</li></ol><p>#developers #webscraping #dataextraction #ZyteAPI #antiban #zyte</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3a947304be5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>