<?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 Khushiatrey on Medium]]></title>
        <description><![CDATA[Stories by Khushiatrey on Medium]]></description>
        <link>https://medium.com/@khushiatrey011?source=rss-4ed507ad5a44------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Xfb-6yCnQ_bix_SUMVkmSg.jpeg</url>
            <title>Stories by Khushiatrey on Medium</title>
            <link>https://medium.com/@khushiatrey011?source=rss-4ed507ad5a44------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 18:11:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khushiatrey011/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[How I Built a Large-Scale Web Scraping & Data Automation Pipeline (A Practical, Beginner-Friendly…]]></title>
            <link>https://medium.com/@khushiatrey011/how-i-built-a-large-scale-web-scraping-data-automation-pipeline-a-practical-beginner-friendly-3779bd73a3e0?source=rss-4ed507ad5a44------2</link>
            <guid isPermaLink="false">https://medium.com/p/3779bd73a3e0</guid>
            <category><![CDATA[scrapy]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Khushiatrey]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 13:14:58 GMT</pubDate>
            <atom:updated>2025-12-10T13:14:58.107Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Built a Large-Scale Web Scraping &amp; Data Automation Pipeline (A Practical, Beginner-Friendly Breakdown)</h3><p><em>By Khushi Atrey</em></p><p>Everyone loves talking about “data engineering,” but very few talk about the messy, painful, oddly satisfying reality of collecting the data in the first place.</p><p>Finding real-world data is not like downloading a CSV.<br> It involves inconsistent HTML, nested structures, missing fields, changing layouts, and a lot of debugging at inconvenient hours.</p><p>This article is an educational breakdown of how I built a scalable scraping and ETL pipeline for a public dataset, the challenges involved, and the engineering decisions behind it.</p><h3>Lesson 1: HTML Is Never What You Expect</h3><p>Tutorial HTML is clean and readable.<br> Real websites are not.</p><p>A common pattern I encountered looked like this:</p><pre>&lt;div class=&quot;row&quot;&gt;<br>    &lt;p&gt;Label:&lt;/p&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;row&quot;&gt;<br>    &lt;p&gt;Value&lt;/p&gt;<br>&lt;/div&gt;</pre><p>Everything used the same classes.<br> Every label and value looked identical.<br> Selectors like the one below were unusable:</p><pre>//div[@class=&quot;row&quot;]/p</pre><p>They returned dozens of unrelated nodes.</p><p>The solution was to rely on <strong>relative structure</strong>, not class names:</p><pre>label = row.xpath(&#39;./div[1]/p//text()&#39;).get()<br>value = row.xpath(&#39;./div[2]//text()&#39;).get()</pre><p>This worked because the layout was consistent: labels always appeared in the first column and values in the second.</p><p><strong>Takeaway:</strong> When scraping, structural relationships are more reliable than HTML classes.</p><h3>Lesson 2: Real Websites Have Multiple Versions</h3><p>The dataset I was extracting had several different layouts depending on year, category, type, and sub-type.<br> Field names changed often:</p><ul><li>“Start Date”</li><li>“Project Start Date”</li><li>“Commencement Date”</li><li>“Date”</li></ul><p>All referring to the same concept.</p><p>To handle this, I created a mapping layer:</p><pre>field_map = {<br>    &quot;Project Name&quot;: &quot;projectName&quot;,<br>    &quot;Project Type&quot;: &quot;projectType&quot;,<br>    &quot;Project Description&quot;: &quot;description&quot;,<br>}</pre><p>This allowed me to convert inconsistent UI labels into predictable JSON keys.</p><p><strong>Takeaway:</strong> Scraping is easy; standardizing inconsistent data is the real challenge.</p><h3>Lesson 3: Scrapy Makes Large-Scale Scraping Practical</h3><p>I started with Selenium. It worked, but it was slow, heavy, and not scalable for thousands of pages.</p><p>Scrapy, on the other hand, offered:</p><ul><li>asynchronous requests</li><li>high performance</li><li>built-in pipelines</li><li>clean extraction logic</li><li>easy exporting</li></ul><p>A typical request looked like this:</p><pre>yield scrapy.FormRequest(<br>    url=&quot;https://example.com/details&quot;,<br>    formdata={&quot;id&quot;: item_id},<br>    callback=self.parse_details<br>)</pre><p>Then I could extract structured rows in a single pass:</p><pre>rows = response.xpath(&#39;//div[@class=&quot;row&quot;]&#39;)</pre><p><strong>Takeaway:</strong> If a website does not require full JavaScript rendering, Scrapy is the right tool.</p><h3>Lesson 4: Dynamic Tables Require Flexible Logic</h3><p>Many sections involved tables with unpredictable structures.<br> They varied in:</p><ul><li>number of columns</li><li>header names</li><li>ordering</li><li>presence or absence</li></ul><p>To reliably extract them, I located the table relative to a heading:</p><pre>table = response.xpath(<br>    &#39;.//h1[contains(text(),&quot;Development&quot;)]/following::table[1]&#39;<br>)</pre><p>Then extracted headers:</p><pre>headers = table.xpath(&#39;.//th/text()&#39;).getall()</pre><p>And parsed rows:</p><pre>for row in table.xpath(&#39;.//tr&#39;)[1:]:<br>    value = row.xpath(&#39;.//td/text()&#39;).get()</pre><p>This approach worked because it ignored column names and relied solely on relative position.</p><p><strong>Takeaway:</strong> Never hard-code table structures; real websites rarely stay consistent.</p><h3>Lesson 5: Nested Sections Require Defensive Scraping</h3><p>Some pages contained deeply nested tables.<br> Scrapy handles these patterns cleanly:</p><pre>for row in response.xpath(&quot;//table[@id=&#39;mainTable&#39;]//tbody/tr&quot;):<br>    cells = row.xpath(&quot;./td&quot;)</pre><p>To deal with unreliable endpoints, I used retry logic:</p><pre>RETRY_HTTP_CODES = [500, 503, 504, 408]</pre><p>This ensured data was not silently skipped.</p><h3>Lesson 6: Store Data in Multiple Collections</h3><p>Beginners often try to store all scraped content in one large JSON file.<br> This becomes impossible to maintain as the dataset grows.</p><p>Instead, I stored the extracted data in normalized collections:</p><ul><li>projects</li><li>details</li><li>inventory</li><li>complaints</li><li>towers</li></ul><p>This made it easier to query, update, and scale the system.</p><p><strong>Takeaway:</strong> Data modeling matters more than scraping once the dataset becomes large.</p><h3>Lesson 7: Automation Turns a Scraper Into a System</h3><p>After the scraper was working, I automated:</p><ul><li>scheduled fetches</li><li>change detection</li><li>partial updates</li><li>notification emails</li><li>error logging</li><li>retries</li><li>verification checkpoints</li></ul><p>A scraping pipeline is not just a script; it is a continuous system that must run reliably without manual intervention.</p><h3>How to Become Better at Web Scraping</h3><p>These principles consistently improved the reliability of my scrapers :</p><ol><li>Start with Scrapy unless the website requires JavaScript rendering.</li><li>Understand the structure of every site before trying to scrape them.</li><li>Prefer relative XPaths (./div[1]/p) over absolute paths.</li><li>Expect multiple formats and design parsers that can adapt.</li><li>Validate all extracted values before storing them.</li><li>Use caching when possible to avoid refetching static data.</li><li>Normalize your schema instead of creating one large JSON object.</li><li>Automate updates from the beginning.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3779bd73a3e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Learned to Talk to the Internet (and It Talks Back)]]></title>
            <link>https://medium.com/@khushiatrey011/how-i-learned-to-talk-to-the-internet-and-it-talks-back-34c645a945c7?source=rss-4ed507ad5a44------2</link>
            <guid isPermaLink="false">https://medium.com/p/34c645a945c7</guid>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Khushiatrey]]></dc:creator>
            <pubDate>Sat, 16 Aug 2025 10:14:43 GMT</pubDate>
            <atom:updated>2025-08-16T10:14:43.270Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ve probably heard all the buzz about data. And trust me, it’s a big deal. But before you get to the cool stuff, you have to learn how to find and clean the data that fuels it all. That was my first lesson, and it was a humbling one.</p><p>When I started my first data role, I thought I was ready. I had some basic Python knowledge and could handle a database. You know, the standard stuff(queries,sql, basic scripting,power bi etc). But then I joined a startup, and it was a whole new scene.</p><p>Instead of a clean database, I was handed a task: “Go scrape ton of websites and make a database.”</p><p>I had no idea what I was doing. So, I did what any beginner would do — I used the script they gave me. It was built with Selenium. My first task? Finding the correct XPath. It took me five days. The whole project, just to add two tiny columns, took over two weeks.</p><p>I remember thinking, “If one tiny task takes this long, I’ll be doing same thing for days.”</p><p><strong>The Moment Everything Clicked</strong></p><p>Then, I found Scrapy. (not a big tech skill but still something)</p><p>It was an absolute game-changer. The exact same task that had taken me 15 days? <strong>Five minutes.</strong></p><p>It felt like I had gone from a bicycle to a rocket ship. I was completely obsessed. I started exploring other tools like Playwright and learned and tried to scrape everything I could. I dove into the details of how websites are structured, how to handle constant IP blocks with smart proxy management, and how to get data that wasn’t meant to be public. For eight months, my life was all about data, and honestly, I am totally hooked.</p><p><strong>The Real Battle</strong></p><p>But here’s the thing — the scraping was only half the battle.</p><p>The real challenge came when I had to turn all that raw, beautiful data into something the company could actually use. When you pull data from a hundred different websites, nothing is the same. The dates are different, the fields and attributes are different, and everything is a mess. It was messy, difficult, and way more complex than the scraping itself.</p><p>The data wasn’t just for a database; it had to be a product. To make the data visible and usable for the whole team. I made designs on Figma, and then learned and built a data product (used TypeScript and React) to create a CRM dashboard where the data I collected and cleaned was populated. This taught me a core lesson: a data engineer’s role isn’t just about the database; it’s about the full lifecycle of the data, from collection to the final product that enables better business decisions.</p><p><strong>The Next Level</strong></p><p>Today, the scraping game has changed again.</p><p>Instead of writing scripts, I’m now using and even building AI agents to do the heavy lifting. Tools like Crawl4ai, can fetch anything, using agents pull text from PDFs using a simple prompt, which saves a ton of time on the boring, low-level stuff.</p><p>This journey has been a wild one. It taught me that technical skills are just one part of the equation. The real secret is sitting at one place for hours trying to figure and think out possile ways to put all the data even when data is completely diff but still try to put together in the most efficient way possible, standardizing it, being stuck with raw data trying to fill out how to fill empty fields, its not an easy task , it is brain fuck stupid thing, still sit with it to make something out of nothing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34c645a945c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>