<?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 Francis Bartheit on Medium]]></title>
        <description><![CDATA[Stories by Francis Bartheit on Medium]]></description>
        <link>https://medium.com/@fbartheit?source=rss-eb38a5061f69------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*q0vcuaEHIGpZSnWsDGR6Kg.jpeg</url>
            <title>Stories by Francis Bartheit on Medium</title>
            <link>https://medium.com/@fbartheit?source=rss-eb38a5061f69------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:54:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fbartheit/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[What to do when you feel Overwhelmed and Unmotivated: A Peculiar Tactic]]></title>
            <link>https://medium.com/@fbartheit/what-to-do-when-you-feel-overwhelmed-and-unmotivated-a-peculiar-tactic-50e4135fa0ae?source=rss-eb38a5061f69------2</link>
            <guid isPermaLink="false">https://medium.com/p/50e4135fa0ae</guid>
            <category><![CDATA[side-hustle]]></category>
            <category><![CDATA[self-management]]></category>
            <category><![CDATA[overwhelmed]]></category>
            <category><![CDATA[motivation]]></category>
            <dc:creator><![CDATA[Francis Bartheit]]></dc:creator>
            <pubDate>Sun, 26 Nov 2023 20:28:31 GMT</pubDate>
            <atom:updated>2023-11-26T20:28:31.206Z</atom:updated>
            <content:encoded><![CDATA[<p>What you’re experiencing is quite common among creative and entrepreneurial individuals. It’s the initial excitement of a new idea that sparks action, but as the novelty wears off and the hard work sets in, motivation can wane. Here’s a strategy that’s a bit unconventional, yet grounded in principles that can help you break the cycle of starting but not finishing:</p><p>**Create Your Personal “Interest Portfolio”:**<br>- Think of yourself as a venture capitalist, but instead of investing money, you’re investing time and energy into projects. Like any smart investor, you don’t put all your resources into one venture. Instead, you diversify.<br>- List all your interests and potential projects, then select 3 to 5 to focus on. These are your “investments”.<br>- Allocate your time like financial resources. Decide how much time you want to invest in each project weekly. For example, Project A gets 5 hours, Project B gets 2 hours, etc. This is your portfolio balance.</p><p>**Develop an “Interest Market”:**<br>- Track the progress and enjoyment of each project like a stock market. Create a simple chart that tracks your interest level and progress on each project over time.<br>- At the end of each week, review your chart. Which project is “up”? Which is “down”? This helps you visualize where your energy is best spent and which projects are yielding results.<br>- Adjust your time investment based on performance. If a project is consistently “down”, consider putting it on hold and reallocating that time to more promising ventures.</p><p>**Host a Weekly “Shareholder Meeting”:**<br>- Once a week, hold a meeting with yourself, or a trusted friend or mentor who can act as a “board member”. Discuss the performance of your portfolio.<br>- Present what you’ve accomplished, where you’ve struggled, and make a case for continuing investment in each project.<br>- Make decisions on whether to continue, pivot, or pause projects based on their performance and your enthusiasm.</p><p>**Implement a “Failsafe Project”:**<br>- Have a smaller, ongoing project that you can complete quickly whenever you feel demotivated. This could be something like a blog post, a short story, or a simple app feature.<br>- Completing these smaller projects can give you a quick sense of accomplishment and help reignite your motivation for larger tasks.</p><p>**Treat Feedback as “Customer Reviews”:**<br>- Regularly seek feedback on your projects from a trusted group of peers or potential customers.<br>- Treat each piece of feedback like a customer review. Positive reviews can boost motivation, while constructive criticism can provide a clear direction for improvement.</p><p>This approach allows for flexibility and a constant reassessment of your interests and progress, making sure you’re always engaged with your projects. It gamifies your productivity and leverages the principles of investment to maintain a diversified, interest-driven workflow. It’s about smart allocation of your most valuable resource — your time — and making sure you’re getting a return on that investment in the form of personal satisfaction and project completion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50e4135fa0ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to scrape Google Search Results Page (SERP scrapping)]]></title>
            <link>https://medium.com/@fbartheit/how-to-scrape-google-search-results-page-serp-scrapping-8e0ad6ba18cd?source=rss-eb38a5061f69------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e0ad6ba18cd</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[best-web-scraping-tool]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Francis Bartheit]]></dc:creator>
            <pubDate>Thu, 10 Nov 2022 23:24:35 GMT</pubDate>
            <atom:updated>2022-11-10T23:24:35.151Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>I’m just a poor boy, but I come from the world of scraping the web, and I found a rare jewel in that world, a jewel that I think will shine brighter if I share it with fellow poor boys and girls.</blockquote><p>It is hard to find a place with more data than Google. And it is easy to use: you just enter the terms for what you are looking for, you press enter, and then enjoy the dopamine hit of having what you’re looking for presented to you in milliseconds.</p><p>But, modern times bring modern problems.</p><p>If you are anything like me, you probably have multiple reasons why you are not satisfied with just having Google results, but you would like to have all of them, all the time, automated, saved, and ready for further use in your many projects.</p><p>On the other hand, if you had a web server and someone was spamming it with hundreds of thousands of requests daily, you wouldn’t like it, would you? But my thinking is, if Google can spam me with dozens of ads every day, it is only fair that I share the same kind of love in return.</p><p>So, the problem that I had to solve is how to scrape thousands of Google result pages a day. With the direct approach, I tried something like this (simplified):</p><pre>package com.fbartheit;<br><br>import java.io.IOException;<br>import java.io.UnsupportedEncodingException;<br>import java.net.URI;<br>import java.net.URLEncoder;<br>import java.net.http.HttpClient;<br>import java.net.http.HttpRequest;<br>import java.net.http.HttpResponse;<br>import java.nio.charset.StandardCharsets;<br>import java.util.List;<br><br>public class DirectApproach {<br><br>    private static String GOOGLE_SEARCH_URL = &quot;https://www.google.com/search?q=&quot;;<br><br>    public static void main(String[] args) throws IOException, InterruptedException {<br>        List&lt;String&gt; keywords = List.of(<br>                &quot;lego&quot;,  &quot;buy lego&quot;,  &quot;lego buy&quot;, &quot;lego toy&quot;, &quot;lego sets&quot;,<br>                &quot;lego sets for babies&quot;, &quot;lego for 1 year old&quot;, &quot;lego crafting box&quot;,<br>                &quot;buy lego crafting box&quot;,  &quot;big lego sets&quot;, &quot;buy big lego sets&quot;);<br><br>        HttpClient client = HttpClient.newHttpClient();<br>        int requestCounter = 0;<br><br>        while (true) {<br>            for (String keyword : keywords) {<br>                HttpRequest request = HttpRequest.newBuilder()<br>                        .uri(URI.create(GOOGLE_SEARCH_URL + encode(keyword)))<br>                        .GET()<br>                        .build();<br><br>                HttpResponse&lt;String&gt; response = client.send(request,<br>                        HttpResponse.BodyHandlers.ofString());<br><br>                System.out.println(&quot;Req. Num: %d | Result: %s&quot;, requestCounter,  response.body());<br>            }<br>        }<br>    }<br><br>    private static String encode(String url) throws UnsupportedEncodingException {<br>        return URLEncoder.encode(url, StandardCharsets.UTF_8.toString());<br>    }<br><br>}</pre><p>Of course, this would be done in multiple threads, with keywords loaded from and external source, and I would process and store the results to my database. I don’t want to complicate this example with all that.</p><p>But, this kind of scrapping gets killed after a few thousand requests ( sent from the same IP address, along with my project and my dreams.</p><figure><img alt="A screenshot of the exception in the code above, which states that Google send the go away message for too many requests." src="https://cdn-images-1.medium.com/max/859/1*uJb0_SMlYhGQ3UjN8ATnpA.png" /><figcaption>It seems that Google does not like this, go wonder</figcaption></figure><p>The problem I had to solve here is obvious: I had to somehow distribute the requests I’m sending to be sent from multiple IP addresses. Or, to be more specific, I had to make the requests reaching Google look like they are coming from many distributed IP addresses. Which meant I needed a proxy cluster.</p><p>At that moment I started looking at different proxy services, with focus on those that offer a pool of IP addresses big enough that I wouldn’t get detected scraping 500K pages a day.</p><p>Needles to say, there are proxy services offering what I needed, such as <a href="https://prowebscraper.com/pricing">ProWebScraper</a>, <a href="https://oxylabs.io/pricing/shared-datacenter-proxies">Oxylabs.io</a> and <a href="https://www.zyte.com/pricing/">Zyte</a>. There are some others, but since these looked most promising to me, I will do the cost analysis for them.</p><p>For <strong>ProWebScraper</strong>, the analysis is easy. Their starting price is $40 for 5K requests. By looking at the cost slider on their pricing page, it’s clear that the cost for 500K scraping requests is $1000. This is if standard requests are being used, where 1 API request = 1 Credit.</p><figure><img alt="ProWebScraper Current Home Page" src="https://cdn-images-1.medium.com/max/1024/1*ijS0YXx3uD7d0EQndk4hfw.png" /><figcaption>ProWebScraper Current Home Page</figcaption></figure><p>While scrapping 500K pages a day, my monthly cost would reach $30K, which was not acceptable to me. I understood that at 15M requests a month the cost would come down significantly from $30k, but the pricing trajectory starting at $40 for 5K requests was not promising.</p><p>Next, <strong>Oxylabs.io</strong>. I realized that they offered two options. One was using the proxy pool to send the requests trough, and then parsing the results myself, and the other one was using their SERP (Search Engine Result Page) scraping service.</p><figure><img alt="Oxylabs.io Current Home Page" src="https://cdn-images-1.medium.com/max/1024/1*2vo8XbWh31TOxn6zYKLAKw.png" /><figcaption>Oxylabs.io Current Home Page</figcaption></figure><p>Pricing for their proxy pool starts at $200 ($100, plus another $100 VAT) for 167GB of traffic. By opening a Google result page in my browser, then saving its content into a .txt file, i found out that its size is roughly 0.5MB. That means 1 SERP request = 0.5MB. In translation, 167GB = 167 * 1024MB = 171 008 MB, which means I could scrape under 350K pages for $200.</p><p>Having in mind that using ProWebScraper 250K requests costs $625, that was promising. My monthly cost would probably be south of $8k, which is better.</p><p>If I were to use their scraping service, they have a plan of $2000 ($999 + $999 VAT) for 526K requests, which is too expensive. Thank you, but I can do the parsing myself.</p><p>Next up, <strong>Zyte</strong>. To simplify things, they offer a plan of $350 for 2.5M requests, with additional $149 per 1M requests. Translated into 15M requests (500K/day) that is just south of $2200. Having in mind that the cost would go down for that many requests a month, this one definitely seamed the cheapest.</p><figure><img alt="Zyte Current Home Page" src="https://cdn-images-1.medium.com/max/1024/1*sW_drAgROOqS90CO9ffBXA.png" /><figcaption>Zyte Current Home Page</figcaption></figure><p>But I still did not want to spend $2K a month on a proxy service.</p><p><em>But then…</em></p><p>Then I found a <strong>jewel</strong>! A jewel worth sharing. And it’s name is <a href="https://www.scraperapi.com/pricing?fp_ref=d_api">ScraperAPI</a>.</p><figure><img alt="A screenshot of the Scraper API web site home page." src="https://cdn-images-1.medium.com/max/1024/1*02IeeSdLECXLmgEb3lPVKQ.png" /><figcaption><a href="https://www.scraperapi.com/?fp_ref=d_api">ScraperAPI</a> Current Home Page</figcaption></figure><p>By opening the pricing page of these guys I was so happy seeing that they have a plan offering 14M requests for $999. I could do with 14M. That was less than half the price of Zyte. That is a 3 digit price. That is something that won’t cause me heart problems when I get the notification from my bank that I payed for the proxy service.</p><p>And <a href="https://www.scraperapi.com/signup?fp_ref=d_api">ScraperAPI</a> has a starting plan of 100K requests for $49. That is much cheaper than 5K requests for $40 (ProWebScraper), 350K requests for $200 (Oxylabs.io minimum plan), or 100K requests for $80 (Zyte).</p><p>Aaaaaaand <a href="https://www.scraperapi.com/?fp_ref=d_api">ScraperAPI</a> has a free plan of 5000K requests for first 7 days, then 1000 free requests a month. So, if your need is smaller, you can just register, and never pay anything, forever.</p><p>Of course, I went with <a href="https://www.scraperapi.com/pricing?fp_ref=d_api">ScraperAPI</a> (and been using it ever since, over 6 months now). The way to use it is simple. Here is the previous code example, using <a href="https://www.scraperapi.com/pricing?fp_ref=d_api">ScraperAPI</a> proxy service:</p><pre>package com.fbartheit;<br><br>import java.io.IOException;<br>import java.io.UnsupportedEncodingException;<br>import java.net.URI;<br>import java.net.URLEncoder;<br>import java.net.http.HttpClient;<br>import java.net.http.HttpRequest;<br>import java.net.http.HttpResponse;<br>import java.nio.charset.StandardCharsets;<br>import java.util.List;<br><br>public class ScraperApiApproach {<br><br>    private static String GOOGLE_SEARCH_URL = &quot;https://www.google.com/search?q=&quot;;<br>    private static String SCRAPERAPI_API_KEY = &quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;;<br>    private static String SCRAPERAPI_URL = &quot;http://api.scraperapi.com?api_key=&quot; + SCRAPERAPI_API_KEY + &quot;&amp;url=&quot; + GOOGLE_SEARCH_URL;<br><br>    public static void main(String[] args) throws IOException, InterruptedException {<br>        List&lt;String&gt; keywords = List.of(<br>                &quot;lego&quot;,  &quot;buy lego&quot;,  &quot;lego buy&quot;, &quot;lego toy&quot;, &quot;lego sets&quot;,<br>                &quot;lego sets for babies&quot;, &quot;lego for 1 year old&quot;, &quot;lego crafting box&quot;,<br>                &quot;buy lego crafting box&quot;,  &quot;big lego sets&quot;, &quot;buy big lego sets&quot;);<br><br>        HttpClient client = HttpClient.newHttpClient();<br>        int requestCounter = 0;<br><br>        while (true) {<br>            for (String keyword : keywords) {<br>                requestCounter++;<br>                HttpRequest request = HttpRequest.newBuilder()<br>                        .uri(URI.create(SCRAPERAPI_URL  + encode(keyword)))<br>                        .GET()<br>                        .build();<br><br>                HttpResponse&lt;String&gt; response = client.send(request,<br>                        HttpResponse.BodyHandlers.ofString());<br><br>                System.out.printf(&quot;Req. Num: %d done.%n&quot;, requestCounter);<br>            }<br>        }<br>    }<br><br>    private static String encode(String url) throws UnsupportedEncodingException {<br>        return URLEncoder.encode(url, StandardCharsets.UTF_8.toString());<br>    }<br><br>}</pre><p>Another awesome thing that <a href="https://www.scraperapi.com/signup?fp_ref=d_api">ScraperAPI</a> can do for you is parsing the SERP page, and returning just the JSON to you. But I think this post is long enough, so I’ll explain how to do that in another post.</p><p>Thanks for reading and hear you in the next post (it’s funny how we can imagine someones voice when reading something they wrote, isn’t it?).</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e0ad6ba18cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>