<?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 Asad B. on Medium]]></title>
        <description><![CDATA[Stories by Asad B. on Medium]]></description>
        <link>https://medium.com/@asadanwar100?source=rss-7032309128f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SaW3tDbwnxAwVfw9.jpg</url>
            <title>Stories by Asad B. on Medium</title>
            <link>https://medium.com/@asadanwar100?source=rss-7032309128f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 00:52:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asadanwar100/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[Building Resilient Web Scrapers]]></title>
            <link>https://medium.com/@asadanwar100/building-resilient-web-scrapers-a3dff4bbbe40?source=rss-7032309128f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3dff4bbbe40</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Asad B.]]></dc:creator>
            <pubDate>Thu, 21 Aug 2025 21:44:54 GMT</pubDate>
            <atom:updated>2025-08-21T21:51:32.263Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is Part 2 of a series on building a full-stack AI ranking engine. Each article should be readable on its own (but you miss out on all the awesome motivation). You can find the rest of the series here:</p><p><a href="https://medium.com/@asadanwar100/building-a-smarter-way-to-choose-a-robot-vacuum-my-60-day-ai-sprint-ca922f7731c9"><em>Part 1: The Vision &amp; The Plan </em></a><em><br></em><strong><em>Part 2: Building a Resilient Web Scraping Pipeline</em></strong></p><p><strong>GitHub: </strong><a href="https://github.com/asadanwar100/robot-vacuum-ranker"><strong>https://github.com/asadanwar100/robot-vacuum-ranker</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2gXGF3m0wdEJ0HL7rJE7w.png" /></figure><p>In the previous post I mentioned the motivation to create a robot vacuum recommender system that narrows down choices based on user needs. The first requirement for any ML project is data, and lots of it. This week is about building the foundation of the system, i.e., the data pipeline.</p><p>In my initial plan, I had identified a few sources for data. As a starting point, I selected two of these sources to start collecting data:</p><ol><li>Vacuum Wars (a static website, which is fairly simple to scrape)</li><li>Amazon (a highly dynamic and adversarial web application)</li></ol><p>Handling data from these very different websites will pave the way to writing web scrapers for other websites.</p><h3>Tools for the Job</h3><p>My initial thought was to use the requests and beautifulsoup4 libraries for Vacuum Wars and a more complex tool for Amazon. After exploring these, along with selenium and playwright, I settled on a single tool for all data collection scripts.</p><p>A core principle of good MLOps is to reduce complexity wherever possible. Managing multiple scraping libraries, each with its own quirks and dependencies, was a recipe for future headaches. I decided to use Playwright for the job since it is a newer framework designed for modern web applications and has fast execution times. While it might seem like overkill for a simpler site, using Playwright everywhere provides:</p><ul><li>Consistency: A single, modern API for all scraping tasks.</li><li>Resilience: It’s future-proof. If Vacuum Wars adds dynamic features tomorrow, my scraper won’t break.</li><li>Power: It easily handles the complex, JavaScript-heavy environment of Amazon, which would be nearly impossible for a simpler library.</li></ul><h3>Creating a Data Lake</h3><p>Before scraping, I set up my Google Cloud Storage to save the raw data. Using a professional approach, I created a structured, partitioned data lake and used two buckets:</p><ol><li>gs://robot-vacuum-recommender-raw-html: This bucket acts as my insurance policy. I save the full, raw HTML of every page I scrape here. With a 14-day lifecycle rule, this data is automatically deleted, giving me a short window to re-parse it if I discover I missed a field, without having to re-scrape the live site and risk getting blocked.</li><li>gs://robot-vacuum-recommender-raw: This is for the clean, structured JSON files that are the output of the parsing process. This is the data that will actually be used by the rest of the pipeline.</li></ol><h3>Scraping Vacuum Wars: Parsing with Pandas</h3><p>The Vacuum Wars review pages contain a beautiful, clean HTML table with the expert scores. This was a perfect use case for the pandas library. Instead of manually looping through rows and cells, you can use a single command: pd.read_html(). You can find the full implementation in the project’s GitHub repository.</p><h3>Scraping Amazon: A Tougher Proposition</h3><p>Amazon is notoriously difficult to scrape. It uses sophisticated anti-bot detection that can serve different content to a headless browser than to a real user. After several failed attempts to get the price and star rating in headless mode, I implemented a multi-layered strategy to make the scraper appear more human:</p><ul><li><strong>playwright-stealth:</strong> A crucial library that patches the headless browser to remove the most obvious signs of automation.</li><li>Persistent Context: The script saves and reuses its browser profile (cookies, session data, etc.) on every run, making it look like a returning visitor, not a brand new bot.</li><li>Intelligent Waits: Instead of fixed time.sleep() calls, the script explicitly waits for each key element (the title, the price, the rating) to become visible on the page before trying to extract it.</li></ul><p>This combination proved to be the key to reliably scraping the data I needed in an automated, headless environment.</p><h3>What’s Next?</h3><p>With the prototype scrapers working, the manual proof-of-concept phase is complete. Now it’s time to make this process scalable and automatic.</p><p>In the next post, I’ll take these local scripts and deploy them as serverless Cloud Functions, building an automated pipeline that can run on a schedule to collect and process data without any manual intervention.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3dff4bbbe40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a smarter way to choose a robot vacuum: My 60 day AI sprint]]></title>
            <link>https://medium.com/@asadanwar100/building-a-smarter-way-to-choose-a-robot-vacuum-my-60-day-ai-sprint-ca922f7731c9?source=rss-7032309128f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca922f7731c9</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Asad B.]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 18:39:55 GMT</pubDate>
            <atom:updated>2025-08-21T21:45:49.068Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is Part 1 of a series on building a full-stack AI ranking engine. Each article should be readable on its own. You can find the rest of the series here:</p><p><strong><em>Part 1: The Vision &amp; The Plan</em></strong></p><p><strong>GitHub: </strong><a href="https://github.com/asadanwar100/robot-vacuum-ranker"><strong>https://github.com/asadanwar100/robot-vacuum-ranker</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Hxy-PBFR5I-nL4_r7LCiA.png" /></figure><p>I have been working in AI research for over a decade now. Most of my work was conducted in academic and research lab settings. I love thinking of new ideas and prototyping them to verify that they work. However, lately the research landscape has become even less friendly for researchers not working in “Big Tech”. In my quest to (finally) make a move to the super-fast-moving industry, I realized that every company is interested in an end-to-end development pipeline. It’s one thing to read Machine Learning System Design books, but I decided the best approach was to build a complete, end-to-end AI product in public, focusing on the MLOps and production-readiness skills.</p><p>Perhaps I can make another post about my interview experiences so far and how ridiculous and archaic are the standard hiring practices.</p><p>However, this post, and hopefully the following posts in this series, are focused on a pet project that I decided to implement. I will document how I am going about this project as it progresses. So, what is this project and why did I choose it? A few days before Prime Day 2025, I decided that I wanted to buy a robot vacuum with mop. I started my research by scouring the internet to find which machine to buy. Searching through Amazon product pages and reviews, Vacuum Wars, RobotVacuums subreddit, and a plethora of Youtube reviews, I ended up being far more confused than at the beginning. Even the best of deep research LLMs were not of much help. I really don’t want to read a 10 page article and end up with “it depends on your needs”. Of course it does! So, I decided that I will create a system whose only job will be to recommend the right robot vacuum for your needs.</p><p>I am going to document my journey to creating this system, and hopefully it will be helpful for some. Before diving in, I want to say a few things about this process. These posts will not be AI written. I want to convey what I actually learned, and writing about my project will make me rethink about some of the choices I made. I will also not be asking an LLM to make this project for me. My experience is that LLM’s don’t really do very well when it comes to large projects, and also that is not the goal of this exercise. I will, however, use web search and LLMs to learn about new technologies that I may be unfamiliar with, and learn about best practices.</p><p>For this project, I plan to use a modern, serverless stack on GCP and emphasize best practices for MLOps and automation. Based on my initial thoughts, I will be using the following key technologies:</p><ul><li><strong>Python: </strong>The foundation for all data processing and model development.</li><li><strong>Google Cloud Platform (GCP)</strong>: For the entire infrastructure, from serverless data ingestion (Cloud Functions) and warehousing (BigQuery) to model training and deployment (Vertex AI).</li><li><strong>Web Scraping</strong></li><li><strong>Natural Language Processing (NLP)</strong></li><li><strong>Docker:</strong> To containerize and serve the final web application</li><li><strong>GitHub Actions:</strong> To build a full CI/CD pipeline, automating testing and deployment from day one.</li><li><strong>Streamlit:</strong> My current front-runner for quickly building an interactive front-end.</li></ul><p>I think this project can be of interest to people who are curious about AI development, cloud implementations, robot-vacuums, and technology in general.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca922f7731c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>