<?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 Melis Uysal on Medium]]></title>
        <description><![CDATA[Stories by Melis Uysal on Medium]]></description>
        <link>https://medium.com/@melissuysal?source=rss-7b3bc7de4d30------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EwvmCOE1E9QVR6a0bqGt7Q@2x.jpeg</url>
            <title>Stories by Melis Uysal on Medium</title>
            <link>https://medium.com/@melissuysal?source=rss-7b3bc7de4d30------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:24:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@melissuysal/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[Here’s a little magic trick for you: Web Crawling!]]></title>
            <link>https://medium.com/@melissuysal/heres-a-little-magic-trick-for-you-web-crawling-116e8095f8ec?source=rss-7b3bc7de4d30------2</link>
            <guid isPermaLink="false">https://medium.com/p/116e8095f8ec</guid>
            <category><![CDATA[jsoup]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-crawling]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Melis Uysal]]></dc:creator>
            <pubDate>Tue, 28 Dec 2021 14:52:19 GMT</pubDate>
            <atom:updated>2021-12-28T14:52:19.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*m1ljzwErbs31jJbz.jpg" /></figure><p>First of all, hello to everyone from my second Medium post. Today we’re going to talk about what Web Crawling is and what platforms it can actually be used on.</p><p><em>When you want to buy a product on the Internet or book a hotel for your trip, you will come across some multi-source sites. These websites actually bring together the data of more than one company that you need. (For example: enuygun.com , hotels , cimri.com , akakce etc.) Moreover, these websites compare the results they find for you! Isn’t it perfect? So let’s imagine how this could be done. Can we do it?</em></p><p><strong><em>Answer: Of course.</em></strong></p><p>So let’s get started. For example, let’s start with a customer who wants to buy technological devices. For now, a company that sells 3 different technological devices is enough for us. We should be able to present the catalog, product and stock information on the websites of these companies to the user in the multi-source application that we will create. For all this information, will we ask companies to share their stock information with us on a regular basis? No. We’ll do web crawling!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*bZHNOamamRX3edE9YvWyIg.png" /><figcaption><strong>Jsoup a Java Library for Web Crawling</strong></figcaption></figure><blockquote><strong><em>JSoup</em></strong></blockquote><blockquote>JSoup is an open source project which provides a powerful API for data extraction. You can use it to parse HTML from URLs, files, and Strings. It can also manipulate HTML elements or attributes.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*bm97r67Jle59WHge.png" /></figure><p><strong>JSoup</strong> is a Java library for working with real-world HTML. It provides a very convenient API for fetching URLs and extracting and manipulating data, using the best of HTML5 DOM methods and CSS selectors.</p><p><strong>JSoup</strong> implements the <a href="https://whatwg.org/html">WHATWG HTML5</a> specification, and parses HTML to the same DOM as modern browsers do.</p><p><strong>(</strong><a href="https://jsoup.org/"><strong>jsoup: Java HTML parser, built for HTML editing, cleaning, scraping, and XSS safety</strong></a><strong>)</strong></p><ul><li>scrape and <a href="https://jsoup.org/cookbook/input/parse-document-from-string">parse</a> HTML from a URL, file, or string</li><li><a href="https://jsoup.org/cookbook/extracting-data/selector-syntax">find</a> and extract data, using DOM traversal or CSS selectors</li><li><a href="https://jsoup.org/cookbook/modifying-data/set-html">manipulate</a> the HTML elements, attributes, and text</li><li><a href="https://jsoup.org/cookbook/cleaning-html/safelist-sanitizer">clean</a> user-submitted content against a safelist, to prevent XSS attacks</li><li><a href="https://jsoup.org/apidocs/org/jsoup/select/Elements.html#html--">output</a> tidy HTML</li></ul><p>To include Java’s Jsoup library in our project:</p><blockquote>import org.jsoup.Jsoup;<br>import org.jsoup.nodes.Document;<br>import org.jsoup.nodes.Element;<br>import org.jsoup.select.Elements;</blockquote><pre>baseURL = &quot;https://www.vatanbilgisayar.com/&quot;;</pre><pre>String webSiteUrl = baseURL + category + &quot;/&quot;;</pre><pre>website = webSiteUrl + &quot;?page=&quot; + pageNumber;</pre><pre>document = Jsoup.connect(website).timeout(0).validateTLSCertificates(false).get();</pre><p>Let’s take a look at Vatan Bilgisayar’s website. I looking for any product. When we view the page source, we can actually see the HTML skeleton.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BtZYabSdC34uBprZlMHJg.png" /></figure><p>Yes here it is! All products displayed under a particular category are positioned in a list. The class information of each list element is the same. Here we will use the<strong><em> “getElementsByClass”</em></strong> method of the Jsoup library. This method actually presents us the entire HTML structure of the class we specified.</p><pre>Elements eventColumn = document.getElementsByClass(&quot;class-name&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXpSd2wbzxr6cZC25f9WMw.png" /></figure><p>After we have the general structure for each product, it is very easy. Product images are placed between img tags. Just below it, there are labels placed for the product name and product price.</p><p>We will use the <strong><em>“select”</em></strong> method to access the HTML tags of each element and the data in it.</p><pre>for (Element e : eventColumn)<br>{<br><br>    String sales = e.getElementsByClass(&quot;urunListe_satisFiyat&quot;).text();<br><br>    if ( sales.isEmpty() != true )<br>    {<br><br>        String detailLink = e.select(&quot;a&quot;).first().absUrl(&quot;href&quot;);<br>        String imgLink = e.select(&quot;img&quot;).first().absUrl(&quot;data-original&quot;);<br>        String productName = e.getElementsByClass(&quot;ems-prd-name&quot;).text();<br>        String store = &quot;VATAN BİLGİSAYAR&quot;;<br>        String category = categoryName;<br><br>        int a = sales.length() - 3;<br>        sales = sales.substring(0, a);<br>        sales = sales.replace(&quot;.&quot;, &quot; &quot;);<br>        sales = sales.replace(&quot;,&quot;, &quot;.&quot;);<br>        sales = sales.replaceAll(&quot;\\s+&quot;,&quot;&quot;); // remove spaces<br>        double price = Double.parseDouble((sales));<br><br>        String path = pathStore + &quot;+&quot; + String.valueOf(katalog.indexOf(category)) + &quot;+&quot; + productCount;<br><br>        Product product = new Product(path, productName, imgLink, price, detailLink, store, category);<br><br>        products.add(product);<br><br>        productCount++;<br>   }<br><br>}</pre><p>We’re doing very well. We got the details of the products. So how do we store this information for our own application? Of course, we will need a database at this stage. If there is no physical database that we prefer, we can use a more dynamic structure. For example, what if we used an online database? Firebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2p5Tq7nczYR_pLFL.png" /></figure><blockquote>Firebase, which has developed with the addition of new features by Google, is a platform that also offers free use, claiming to meet all these needs. You must have started developing applications on any platform for a reason and then immediately felt that you needed a control panel and a user data store available in any situation.</blockquote><blockquote>Today, applications want to access the same data from every device, regardless of platform. Developers whose application has been installed by many users also need a management panel where they can easily manage processes such as recording — keeping session information, analyzing the usage data of applications, sending notifications to the user to make new announcements, and testing the application.</blockquote><blockquote>Firebase, which is constantly improving with the addition of new features by Google, is a platform that offers free use to application developers in order to meet all these needs.</blockquote><p>If you want to present a real application, all you have to do is to simultaneously parse the catalog, product and stock information obtained from the websites of the companies and dynamically update your Firebase database.</p><p>To learn more, please visit the resources below. Enjoy coding :)</p><p><a href="https://www.baeldung.com/java-with-jsoup">https://www.baeldung.com/java-with-jsoup</a></p><ul><li><a href="https://jsoup.org/">jsoup: Java HTML parser, built for HTML editing, cleaning, scraping, and XSS safety</a></li><li><a href="https://firebase.google.com/">Firebase | Google&#39;s Mobile and Web App Development Platform</a></li><li><a href="https://try.jsoup.org/">Try jsoup online: Java HTML parser and CSS/Xpath debugger</a></li></ul><p><a href="https://try.jsoup.org/">Try jsoup online: Java HTML parser and CSS/Xpath debugger</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZ3m3yKcWeP-Hbs5UEY60w.png" /><figcaption><strong>Try Jsoup Online Page</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=116e8095f8ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing Success Assistant with Web Using Mining (with Kafka and Apache Spark)]]></title>
            <link>https://medium.com/@melissuysal/developing-success-assistant-with-web-using-mining-with-kafka-and-apache-spark-dfc1c9b65205?source=rss-7b3bc7de4d30------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfc1c9b65205</guid>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[association-rule]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[web-usage-mining]]></category>
            <dc:creator><![CDATA[Melis Uysal]]></dc:creator>
            <pubDate>Fri, 08 Oct 2021 14:18:18 GMT</pubDate>
            <atom:updated>2021-10-08T14:23:34.036Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, here is my first Medium article!</p><p>Today, in this article, we will talk about developing a web usage mining based success assistant system on e-commerce sites and e-portals using message queues like Kafka and data mining libraries like Apache Kafka.</p><blockquote><strong>Why do we need the Success Assistant system?</strong></blockquote><p>In today&#39;s technology, many e-commerce sites and e-learning portals are used to serve different sectors. Monitoring the trends of users on e-commerce sites and e-learning portals and making inferences based on the trends of other users is a goal to increase success.<br>From the software side, the work of the Success Assistant system can be summarized as the <em>«Recomendation System»</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*LcYlyHLbP0_oQb9VksSv8w.png" /><figcaption>Web Usage Mining Flowchart</figcaption></figure><p>First of all, let&#39;s assume that we have user log data of an e-system. At this point, there is something we should pay attention to! <strong><em>The company will not share the username or other personal information of the user with us while giving us the log data.</em></strong></p><blockquote>So how do we do user detection?</blockquote><p>Here we need to do some pre-processing. A specific user id can be obtained by covering browser information, IP information and operating system information of each row transaction in the log data we obtained from the company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*rfWMKgF2x4L9ZU7LyDwWgw.png" /><figcaption>Estimated User Id Components</figcaption></figure><p>One small point; we need to remove some unnecessary data from the log data that does not include user clicks. E.g:<br> <em>• Logo and PNG downloads<br> • Homepage redirects<br> • BOT interactions<br> • Directions to e-system from other sites<br> • User actions on other sites redirecting to e-system (etc.)</em></p><blockquote><strong>What do we need now?</strong></blockquote><p>We have determined the user ids and click movements, but how will we incorporate this data into the system we will develop? We need a structure like Stream. The <a href="https://kafka.apache.org/"><strong><em>Kafka</em></strong></a> message queue is perfect for this.</p><pre><em>Kafka is a platform developed by LinkedIn in 2011 with Scala and presented to us as open source. A solution usually offered under the category Distributed Streaming Platform. </em>We can say that the biggest reason why Kafka is used in streaming processes is that the messages it carries/stores can be large and the delay (consumer lag) is at minimum levels.</pre><p>Before we start, we need to install Kafka Broker. <strong>Broker</strong> is actually a virtual or physical machine on which Kafka is installed and running. In order to raise the broker, we need the <a href="http://zookeeper.apache.org/releases.html#download"><strong><em>Zookeeper</em></strong></a>. Let&#39;s pass each user click gesture to the Consumer with Kafka&#39;s Producer structure, which will be a JSON object. Thus, we will have a flowing data.</p><blockquote>Zookeeper is yet another platform that belongs to the apache family. It provides coordination in similar distributed systems. Also, we cannot use Kafka alone, even if we have only one broker, we need Zookeeper.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*I0BkuiCmpvV_68_jWJa9bw.png" /><figcaption>Apache Kafka Overview</figcaption></figure><p><strong><em>Producer</em></strong> sends messages to kafka side. Here, the message is transmitted as a key-value. In addition, it is required to specify the name of the Topic to be transmitted, apart from the key and message information.<br><strong><em>Topic</em></strong> is used to categorize/group sent messages. Messages of the same type sent by producers are stored on topics.<br><strong><em>Partition</em></strong> is another stakeholder of Kafka that RabbitMQ&#39;s on the one hand. You can think of it as subsections in a topic, and the reason for use is to scale the messages in the topic by distributing them one by one to these partitions. Another way to use it is to copy and send messages to each partition in the topic so that many different consumers can receive the same message.</p><blockquote>We obtained user click actions as a flowing stream in Kafka&#39;s Producer/Consumer structure. So how do we measure the success of this e-system?</blockquote><p><strong><em>Association Rules</em></strong></p><p>Association rules are a topic that you can often hear in the world of data mining. The association rule is an approach that supports the analysis of past data and the determination of association behaviors in this data, and future studies. The most typical example of using association rules is <em>Market Basket Analysis</em>.</p><p>We can define these association rules using <strong><em>FP-Growth</em></strong> and <strong><em>Apiori</em></strong> algorithms. The FP-Growth algorithm is already defined in <strong><em>Apache Spark</em></strong>&#39;s <a href="https://spark.apache.org/docs/2.4.0/mllib-frequent-pattern-mining.html"><strong><em>MLLib Library</em></strong></a>. We can use this directly. However, in order to use Apache Spark, <a href="https://hadoop.apache.org/"><strong><em>Hadoop</em></strong></a> must be installed on our computer first. We can implement the Apriori algorithm using one of the Java or Python programming languages.</p><pre>Apache Spark is a fast, in-memory data processing engine with elegant and impressive development APIs that enable data workers to efficiently execute streaming, machine learning or SQL workloads that require fast iterative access to datasets. Apache Spark version 1.0 was released in May 2014 and has been the most preferred data processing engine ever since.This technology was first designed by researchers at the University of California in 2009 to speed up operations in Hadoop systems.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*5r7eF2oAoSGXNDp1MFcODQ.png" /><figcaption>General architecture of Apache Spark</figcaption></figure><p>On the side of creating association rules using Apache Spark, two different algorithm have been runned. The codes that these algorithms run are as follows:</p><ul><li>FPGrowthSample</li><li>AprioriSample</li></ul><p>Since apriori scans the database in each of its steps it becomes time-consuming for data where the number of items is larger. FP-tree requires only one scan of the database in its beginning steps so it consumes less time.<br>A converted version of the database is saved in the memory. Set of conditional FP-tree for every item is saved in the memory.</p><blockquote>Let&#39;s take a look at the performance status of these two algorithms in the sample success assistant project I developed:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*1A3QoEBZ2x4PKAbo9CuOEw.png" /></figure><p>As a conclusion; if you want to develop an achievement assistant system, you will need to follow the steps below:<br> — Preprocess step to detect user id<br> — Creating event stream using Kafka<br> — Processing data mining algorithms (FP-Growth / Apriori ) to obtain Association Rules with Apache Spark</p><p>You can visit the links below for sample projects and detailed source information on the subject.</p><blockquote><a href="https://www.researchgate.net/publication/282951340_Association_rule_mining_for_web_usage_data_to_improve_websites">https://www.researchgate.net/publication/282951340_Association_rule_mining_for_web_usage_data_to_improve_websites</a></blockquote><blockquote><a href="https://www.researchgate.net/publication/270553699_A_Web_Mining_Approach_for_Personalized_E-Learning_System">https://www.researchgate.net/publication/270553699_A_Web_Mining_Approach_for_Personalized_E-Learning_System</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfc1c9b65205" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>