<?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 Todi Rahmat on Medium]]></title>
        <description><![CDATA[Stories by Todi Rahmat on Medium]]></description>
        <link>https://medium.com/@todirahmat?source=rss-2b1552e9fa22------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5zCu4qAAT49wZarZVbjyFA.jpeg</url>
            <title>Stories by Todi Rahmat on Medium</title>
            <link>https://medium.com/@todirahmat?source=rss-2b1552e9fa22------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:37:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@todirahmat/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[A Beautiful Soup 4 use case: Hunting data from freelancer.com]]></title>
            <link>https://medium.com/@todirahmat/a-beautiful-soup-4-use-case-hunting-data-from-freelancer-com-2f156ecc3162?source=rss-2b1552e9fa22------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f156ecc3162</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Todi Rahmat]]></dc:creator>
            <pubDate>Thu, 16 Jun 2022 15:26:58 GMT</pubDate>
            <atom:updated>2022-06-16T15:30:58.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1smX7lEW22deAURc" /><figcaption>Photo by <a href="https://unsplash.com/@rosssneddon?utm_source=medium&amp;utm_medium=referral">Ross Sneddon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Hello medium reader, this article will focus on web scraping.</blockquote><p>Imagine how many organizations, companies, and communities need or depend on data. Nowadays data is “new oil” because data becomes very important thing.</p><p>One way or method to get data is to use web scraping, yep web scraping includes three stages:</p><ul><li><strong>Request</strong>, It starts with the process of requesting to the website to extract all the data from this website.</li><li><strong>Parse</strong>, At this stage, we will look for specific elements on the website page that contain the data we need.</li><li><strong>Display</strong>, Make data into structured data.</li></ul><p>Here’s the web scraping cycle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*Rhlxkq6EJnOj1snJYEyDZg.png" /></figure><p>I will take the data from freelancer.com to get a job listing.</p><p>Make sure you have installed the following packages</p><ul><li>beautifulsoup4</li><li>requests</li><li>pandas</li><li>openpyxl</li></ul><p>Install with the following command</p><pre>pip install beautifulsoup4 requests pandas openpyxl</pre><p>After that import the package we need</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*WAwe4sUAsaOiZ0Y_xi3Lbg.png" /></figure><p>Make sure you’re familiar with HTML. Why? Because it is helpful to search for HTML tags which contains the data we want.</p><p>Firstly, open freelancer.com and click page inspection. Here’s the data we’ll take</p><ul><li>Job title</li><li>Salary</li><li>Job link</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioIx1gNDgSvki0gOFjAayQ.jpeg" /></figure><p>Next, find the HTML tag that wraps the data we need</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*x0ER5lL-bDGlGVpoyd1icg.jpeg" /></figure><p>As we see in the image above HTML tag that wraps the data is :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*jCF_b3u1rlvI1vMCbPTLKA.png" /></figure><p>Next, look for the job title and job link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SBJ5J2nYVX0jhGvAZHPY8w.png" /></figure><p>Lastly, we’ll look for tags that wrap salary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*-U92shlUe1I4NrjaGRHZHg.png" /></figure><p>Let’s start coding, let’s go…</p><p>I’ll create a function to retrieve and process the data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_FETuJvMVimdazUrB7pTRw.png" /><figcaption>fungsi get data</figcaption></figure><p>Next, I’ll create a function for generating a file csv and excel which contain job list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuj564CFxaTrSZCechn6Eg.png" /><figcaption>fungsi generate file</figcaption></figure><p>Lastly, I’ll create run function -&gt; this function will loop against the function get data, then the data will be written in a json file and generate file function will be called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdvK4CvTJB91xN2G0qqUTw.png" /></figure><p>Here’s the complete coding</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea74ab48c16d9ff3ab3c69cb6531097d/href">https://medium.com/media/ea74ab48c16d9ff3ab3c69cb6531097d/href</a></iframe><h3><strong>Summary</strong></h3><p>Once you have read and understood this article</p><ul><li>You know how to use Beautifulsoup 4</li><li>You can retrieve data from the web freelancer.com</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f156ecc3162" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Guide to Learn Python for Beginner — Chapter 2: Practice Branching and Looping]]></title>
            <link>https://medium.com/@todirahmat/a-simple-guide-to-learn-python-for-beginner-chapter-2-practice-branching-and-looping-ef4415e7c1c5?source=rss-2b1552e9fa22------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef4415e7c1c5</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Todi Rahmat]]></dc:creator>
            <pubDate>Thu, 09 Jun 2022 14:03:24 GMT</pubDate>
            <atom:updated>2022-06-09T14:07:00.318Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@todirahmat/a-simple-guide-to-learn-python-for-beginner-chapter-1-installation-b55eb7b9e161?source=your_stories_page-------------------------------------">A Simple Guide to Learn Python for Beginner — Chapter 2: Practice</a> Branching and Looping</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kqmvROZ3AEIa4W1E" /><figcaption>Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=medium&amp;utm_medium=referral">Hitesh Choudhary</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>If you just heard the words <strong>Branching </strong>and <strong>Looping</strong>, what it’s that? Don’t worry, I will discuss it with an explanation that makes it easier for you.</blockquote><h4><strong>1. Branching</strong></h4><p>In everyday life you always make choices in your activities. For simple example, “<em>if you have money then you will eat in a restaurant, if you don’t have money then you eat at home”</em>.</p><p>In programming, Branching describes the flow of branched programs, and also as a control decision. For more details you can see the flowchart below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*mAR26-QTmhTbw_nIEMAm5g.jpeg" /></figure><p>In Python sintax or statements used in branching are :</p><ul><li><strong>if</strong></li><li><strong>elif</strong></li><li><strong>else</strong></li></ul><p>Let’s practice the use of branching</p><pre>money = &#39;yes&#39;</pre><pre>if money == &#39;yes&#39;:<br>   print(&#39;Eating in restaurants&#39;)<br>else:<br>   print(&#39;Eating at home&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*3gyDQLppQwfatTKKcmI3tw.png" /></figure><h4>2. Looping</h4><p>Looping is the process of executing lines of code continuously until certain conditions. For more details you can see the flowchart below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*OG0L77tDmG85Y8LAkf_DEg.jpeg" /></figure><p>How to print “sorry” five times?</p><pre>print(&#39;sorry&#39;)<br>print(&#39;sorry&#39;)<br>print(&#39;sorry&#39;)<br>print(&#39;sorry&#39;)<br>print(&#39;sorry&#39;)</pre><p>The command using print(‘sorry’) five times is correct, but how to print “sorry” a hundred times? Imagine if you used the same command for a hundred times then you will spend a lot of time. To make it easier we will use Looping called <strong>For</strong>, and <strong>While</strong>.</p><ul><li><strong>For</strong></li></ul><pre>word = &#39;sorry&#39;</pre><pre>for i in range(100)<br>    print(word) </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*w4Gy1Lt71h0leUPwUwSu3g.png" /></figure><p>With method range() we can looping more faster to print “sorry” a hundred times.</p><ul><li><strong>While</strong></li></ul><pre>word = &#39;sorry&#39;<br>i = 1</pre><pre>while i &lt;= 100<br>   print(&#39;word&#39;)</pre><pre>   i += 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*XbBfI3uglU950-GWwdgWwg.png" /></figure><p>A little different with <strong>For</strong>,</p><ol><li>The program will perform looping during <strong>i</strong> value less equal to 100</li><li>Each iteration <strong>i </strong>value will increase 1</li><li>Program will stop when <strong>i </strong>value more than 100</li></ol><p>What if the iteration is deleted? then program will not stop to print “sorry”, because <strong>i </strong>value will always 1 and it will cause infinite loop.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef4415e7c1c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Guide to Learn Python for Beginner — Chapter 1: Installation]]></title>
            <link>https://medium.com/@todirahmat/a-simple-guide-to-learn-python-for-beginner-chapter-1-installation-b55eb7b9e161?source=rss-2b1552e9fa22------2</link>
            <guid isPermaLink="false">https://medium.com/p/b55eb7b9e161</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Todi Rahmat]]></dc:creator>
            <pubDate>Sat, 28 May 2022 05:27:21 GMT</pubDate>
            <atom:updated>2022-05-28T05:27:21.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Simple Guide to Learn Python for Beginner — Chapter 1: Installation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TqnYrdHcuIRrSzgR" /><figcaption>Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=medium&amp;utm_medium=referral">Hitesh Choudhary</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>This article aims to provide you with an easy guide in the first steps of using Python.</blockquote><p>Hello medium reader, how are you? The first chapter starts with the installation guide. Take it easy, installing python is not complicated and doesn’t need a lot of confusing configurations. Can not wait? Let’s go to the steps.</p><h4>1. Download Python</h4><p>Open your browser and visit the official Python site here <a href="https://www.python.org/"><strong>https://www.python.org/</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5wLMVGPpmjsR1cVGuvhnQ.png" /></figure><p>Hit the download button Python 3.10.4, at the time this article was published, Python 3.10.4 was the latest version.</p><h4>2. Install Python</h4><p>After the download is complete, then just install click next, click next again until the finished screen appears. To make sure Python is installed correctly, you can check it via terminal with the following command</p><pre>py --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*QiHjm6Btuep37x5YFNhPww.png" /></figure><p>Don’t worry my version is a little different from the latest version, it’s just that I haven’t updated the version yet.</p><p>If the <strong>py </strong>command is not recognized You just need to add the <strong>PATH </strong>in environment variable. It’s easy, you just go to the control panel and type in the search field “environment variable”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*IIyfQWDS8gunUVHzxOWO0g.png" /></figure><p>Then click <strong>Edit the system environment variables &gt; Environment variables &gt; System variables &gt; Path &gt; New &gt; “</strong>add your python folder location” <strong>C:\Python310\ &gt; OK</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*e-pyTgMS_BnqOoCM7NNheA.png" /></figure><p>Almost done here, but we will try to run python basic syntax which is display “Hello world”. For this time I will use the terminal only. You can use the following command</p><pre>&gt;&gt; py</pre><pre>&gt;&gt; print(&#39;Hello world&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*nyDfscHLP1PHy9EFVu75NA.png" /></figure><p>Congratulations you have successfully run your first python application. To stop running python in your terminal type the following command</p><pre>exit()</pre><h4>3. Using PyCharm as a Code Editor</h4><p>You are free to use Sublime text, Visual Studio Code, Notepad++, or other. In this moment I use Pycharm. Before that make sure you have downloaded it at <a href="https://www.jetbrains.com/pycharm/">https://www.jetbrains.com/pycharm/</a> choose the community version so we can use it for free.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWZHiaRzWm5wp9lBFYgT4w.png" /></figure><p>After you’re done the installation, open PyCharm and create a new file. I will run a few lines of code and you can type the following command</p><pre>print(&#39;Hello&#39;)<br>print(&#39;My name is Todi&#39;)<br>print(&#39;This is my first project&#39;)</pre><p>For run it, hit your right mouse button and select run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7QekM3kwDzFsUExCR5Xpw.png" /></figure><blockquote>Wohoooo…. You have successfully run your first Python application.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQYCuSypJy5BjP8WAqZqvw.png" /></figure><p>See you in the next chapter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b55eb7b9e161" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>