<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Priyanka Kore</title>
    <description>The latest articles on Forem by Priyanka Kore (@piyukore06).</description>
    <link>https://forem.com/piyukore06</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F113809%2Ffbf4e192-559c-4a93-ba3d-d73269fa538f.jpg</url>
      <title>Forem: Priyanka Kore</title>
      <link>https://forem.com/piyukore06</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/piyukore06"/>
    <language>en</language>
    <item>
      <title>  Chrome Local Overrides</title>
      <dc:creator>Priyanka Kore</dc:creator>
      <pubDate>Sat, 23 Nov 2019 21:34:24 +0000</pubDate>
      <link>https://forem.com/piyukore06/chrome-local-overrides-1f49</link>
      <guid>https://forem.com/piyukore06/chrome-local-overrides-1f49</guid>
      <description>&lt;p&gt;Don't we all just love devtools. They make our lives so better. Recently I learned about a supercool chrome devtool feature. It's actually been available since chrome 65 release. If you haven't heard about it yet, well, you are in for a REAL TREAT.&lt;/p&gt;

&lt;p&gt;Local Overrides lets you make code changes in devtools, which are persistent across page loads. 🤯 In short, it’s like having a devtools instance that doesn’t change when you reload.&lt;/p&gt;

&lt;p&gt;This can be immensely useful to debug production errors, performance problems or style related issues. It can be also useful to all the freelancers who don't get the access to the actual codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's get you set up!!
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to the &lt;code&gt;sources&lt;/code&gt; tab and click on &lt;code&gt;overrides&lt;/code&gt;. If you don't see &lt;code&gt;overrides&lt;/code&gt; right away, you can click the two arrows icon and a dropdown will show, it might be hiding there.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuqag00n4bct341pp7h3n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuqag00n4bct341pp7h3n.jpg" alt="Sources tab"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a folder on your local machine. Let's name it &lt;code&gt;local-overrides&lt;/code&gt;. In devtools click on &lt;code&gt;select folder for overrides&lt;/code&gt; and select the folder. This is the folder chrome will use to save and access your changes. Don't forget to allow devtools access to our folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fchyeb0cv97as1lhjr41u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fchyeb0cv97as1lhjr41u.png" alt="Select folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A new checkbox &lt;code&gt;Enable local overrides&lt;/code&gt; will appear, Check that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9jqdq7h1naazyrbaxheh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9jqdq7h1naazyrbaxheh.png" alt="Enable local overrides"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You are now ready to start playing around!!
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Editing styles:&lt;/em&gt; Go to &lt;code&gt;elements&lt;/code&gt; tab and edit any style and reload. You will see that styles are persistent. You can also see that the source of the file is now changed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbossxk58d5fqke0zwirg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbossxk58d5fqke0zwirg.png" alt="Edit Styles"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Editing Header:&lt;/em&gt; Go to &lt;code&gt;sources&lt;/code&gt; tab and as the message suggests press &lt;code&gt;cmd + p&lt;/code&gt; (Mac OS) or &lt;code&gt;ctrl + p&lt;/code&gt; (Windows) a search dropdown will appear. Search for the file you want to edit. Edit the title and reload.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frlh0mmrny8byllo1tnd8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frlh0mmrny8byllo1tnd8.png" alt="Edit Header"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Edit Image:&lt;/em&gt; Open the image you want to change from the webpage in &lt;code&gt;sources&lt;/code&gt;. Now just drag the new image onto this and reload, and as you can see the changes are persistent. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fx0t13pwl6bcimhwo9c7i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fx0t13pwl6bcimhwo9c7i.gif" alt="Edit Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Changes
&lt;/h3&gt;

&lt;p&gt;If you look closely at one of the above changed files in &lt;code&gt;sources&lt;/code&gt; tab, you will see all the changed lines are displayed with a purple mark to the left. You can also see all the changes at once using the &lt;code&gt;changes&lt;/code&gt; panel. To open the panel you can press &lt;code&gt;cmd + shift + p&lt;/code&gt; (Mac OS) or &lt;code&gt;ctrl + shift + p&lt;/code&gt; (Windows) and type &lt;code&gt;show changes&lt;/code&gt; thereby selecting that option from dropdown.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff7w6jy3ulpj7ch9wceux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff7w6jy3ulpj7ch9wceux.png" alt="Changes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is such a lightweight solution. If you go back to the ‘local-overrides’ folder you will see only those files are saved the one's you changed. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0ttot711juguawk0yzm2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0ttot711juguawk0yzm2.png" alt="Changed files"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;As you could edit the styles in &lt;code&gt;elements&lt;/code&gt;. You cannot edit the HTML the same way. You have to search that particular file in &lt;code&gt;sources&lt;/code&gt; and edit it there.&lt;/li&gt;
&lt;li&gt;You cannot edit the styles to be persistent in &lt;code&gt;elements&lt;/code&gt; at &lt;code&gt;element.style&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fs7kharoqp1nvrxuaim2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fs7kharoqp1nvrxuaim2g.png" alt="Element styles"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you know about this feature. Go out there and have fun debugging :) :)&lt;/p&gt;

&lt;p&gt;Photo by Priscilla Du Preez on Unsplash&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>devtools</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>5 non tech podcasts you should listen to</title>
      <dc:creator>Priyanka Kore</dc:creator>
      <pubDate>Sat, 27 Jul 2019 07:28:08 +0000</pubDate>
      <link>https://forem.com/piyukore06/5-non-tech-podcasts-you-should-listen-to-3j1o</link>
      <guid>https://forem.com/piyukore06/5-non-tech-podcasts-you-should-listen-to-3j1o</guid>
      <description>&lt;p&gt;If you have a longer commute, podcasts are really good to utilize that time. There's some really amazing technical podcasts out there. but sometimes after along day at work, you are not up to listing to any more tech talk but you still want to gain some value out of it. That's where this blog post can help you.&lt;/p&gt;

&lt;p&gt;Below are the 5 non tech podcasts you should absolutely subscribe to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://softskills.audio/"&gt;Soft skills engineering&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Soft skills podcast is not not really a tech one(get it 👈🏻). Dave and Jamison are the most hilarious duo. I can't tell you how many times I burst out laughing in a silent train to get strange looks from people. With all the fun you always end up learning something. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://curiosity.com/"&gt;Curiosity Daily&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are a science trivia connoisseur, Curiosity is just the podcast for you. It'll just take 10 minutes of your time (lesser when you 2x ;)) and you always end up learning something interesting. I enjoy this podcast so much, there's just so much out there that we don't know.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://podcasts.apple.com/us/podcast/planet-money/id290783428"&gt;Planet Money&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the economy aficionados will love this one. Planet money's tagline says, Economy explained. and it does just that. I like to know, what'a happening in the world. Sometimes we listen to some economy related news, without knowing why certain thing is happening and how it is all connected. Planet money does a great job explaining the little things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://podcasts.apple.com/us/podcast/how-i-built-this-with-guy-raz/id1150510297"&gt;How I Built This&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This one will overcharge you with full of inspiration. Innovators from different backgrounds talk about how they build their company. There are such beautiful inspirational stories. For me, when I listen to something like this, it sets a positive and productive tone for the whole day.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://podcasts.apple.com/us/podcast/meditation-minis-podcast/id963597166?mt=2"&gt;Meditation minis&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This the goto podcast when you've had a busy day, stressed about something or deal with anxiety. As the name suggests it's little nuggets of relaxation and mindfulness to leave the stressful parts of days behind you.&lt;/p&gt;

&lt;p&gt;Thank you for reading! 🙏&lt;/p&gt;

&lt;p&gt;If you liked the article, please share it with your friends and coworkers!&lt;/p&gt;

&lt;p&gt;Photo by Tiard Schulz on Unsplash&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>podcast</category>
      <category>productivity</category>
    </item>
    <item>
      <title>An introvert's guide to making the most of meetups</title>
      <dc:creator>Priyanka Kore</dc:creator>
      <pubDate>Sat, 20 Jul 2019 06:32:06 +0000</pubDate>
      <link>https://forem.com/piyukore06/an-introvert-s-guide-to-making-the-most-of-meetups-2k84</link>
      <guid>https://forem.com/piyukore06/an-introvert-s-guide-to-making-the-most-of-meetups-2k84</guid>
      <description>&lt;p&gt;Meetups are a great place to meet like minded people and share the thoughts and ideas. But honestly, being an introvert at a meetup is NOT fun. You know you wanna learn but you are constantly thinking about, how you are not contributing to any conversation. And just thinking about how intimidating this whole thing is. I am from a foreign country and live in Germany. It's even harder to jump into conversation in a language you barely know.&lt;/p&gt;

&lt;p&gt;I just want to clear that, I am not a subject matter expert. I go to a lot of meetups and have personally gone through some problems with talking to people. This is kind of my experience and How I am trying to get over that fear.&lt;/p&gt;

&lt;p&gt;It's Okay&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if you are nervous&lt;/li&gt;
&lt;li&gt;if you don't know anyone&lt;/li&gt;
&lt;li&gt;if you just feel like leaving, because you feel nobody's gonna miss you, if you're gone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's all okay, these things have happened to most people. Just remember, you are here to learn.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Find the right meetup for you:&lt;br&gt;
If you are at a meetup, where you cared about the topic, you will feel like you know the topic or you don't know and are very curious about it. Both of these things can help with starting a conversation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Listen attentively:&lt;br&gt;
Listening sounds so simple yet is very helpful. You become a more active listener: you’re guaranteed to learn more and have a good reason to start a conversation with speakers during or after the event. When you listen to what people are talking about. It is often easier to ask counter questions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Body language:&lt;br&gt;
Maintaining eye contact, having an open posture establishes you as a confident person. Right alignment shows you are interested in a conversation. Greeting people with smile and handshake just sets the tone for whole conversation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smile:&lt;br&gt;
It is sometimes very hard to break the ice. In this case, smile goes a long way. If you have met someone at another meetup, just say Hi to people you’ve already met. You’ll be able to politely join conversations and meet more people.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Importance of starting the conversation:&lt;br&gt;
Don't wait around thinking that someone will notice and speak with you. Chances of that happening are very slim. Instead just find a group of people you feel you can talk to. Go over there, introduce yourself, just be curious about the person and about their tech stack and within no time, conversation will flow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ask a lot of questions:&lt;br&gt;
If you don’t make your experiences engaging for yourself, you are guaranteed to be bored. Talk to the speaker or the people sitting next to you, whoever. Ask for recommendations for books, websites or other meetups. If you don’t become an active participant in your own learning, don’t be surprised if not much of what you experience is relevant to you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keep trying:&lt;br&gt;
Every person is unique. If one approach isn't working for you. Just change the approach and "rinse and repeat" again till you find the right approach for yourself.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now go out there and get the most learning experience out of the meetup. Here are some of the questions you can start with&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How did you find this meetup?&lt;/li&gt;
&lt;li&gt;Is this your first time here?&lt;/li&gt;
&lt;li&gt;What interesting approach you take to solve a similar problem?&lt;/li&gt;
&lt;li&gt;Book and website recommendations on the topic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay positive and happy Learning!!!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>career</category>
      <category>learning</category>
    </item>
    <item>
      <title>Traveling Salesman Problem </title>
      <dc:creator>Priyanka Kore</dc:creator>
      <pubDate>Fri, 12 Jul 2019 17:25:39 +0000</pubDate>
      <link>https://forem.com/piyukore06/traveling-salesman-problem-4ano</link>
      <guid>https://forem.com/piyukore06/traveling-salesman-problem-4ano</guid>
      <description>&lt;p&gt;A couple of weeks ago, I heard about a mathematical problem, which is unsolvable. It peaked my interest. I researched about it and here's what I found out. This blog post is dedicated to all the math nerds out there.&lt;/p&gt;

&lt;p&gt;Since the Renaissance, every century has seen the solution of more mathematical problems than the century before, yet many mathematical problems, both major and minor, still remain unsolved. Traveling salesman problem is one of those classic algorithm problems from the class of &lt;code&gt;hard&lt;/code&gt; optimisation problems, which has been marked as &lt;code&gt;unsolvable&lt;/code&gt; for over two centuries.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem Statement 📜&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given a n number of cities, what is the most efficient route you can take to visit each city and come back where you started&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sounds simple, why is it unsolvable 🤔&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sounds so easy, especially if you're working with computers. all you gotta do is check the distance of every round trip and shortest one is your answer. If you have &lt;code&gt;n&lt;/code&gt; cities, you will have &lt;code&gt;(n-1)!&lt;/code&gt; possibilities. We only count half since each route has an equal route in reverse with the same length or cost. so it's &lt;code&gt;(n-1)!/2&lt;/code&gt;. So there you go! we cracked it?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Well that is not good enough. For obvious reasons, that way of solving the problem is known as the naive solution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;The big WHY??&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Throughout the years, scientists have come up with newer algorithms to solve the problem. In the early days of computer science, people figured out solutions to scenarios involving a specific number of cities, but a way to solve every traveling salesman problem with a single algorithm (that is, a single list of rules a computer can follow to find the solution) still remains hard to achieve. In the 1970s, mathematician Richard Karp published a &lt;a href="https://people.eecs.berkeley.edu/~luca/cs172/karp.pdf"&gt;paper&lt;/a&gt; that suggested we might never find the solution. He showed that the problem is &lt;a href="https://simple.wikipedia.org/wiki/NP-hardness"&gt;NP-hard&lt;/a&gt;, which means that there will never be an algorithm to solve it 😲&lt;/p&gt;

&lt;p&gt;Photo by Charles Forerunner on Unsplash&lt;/p&gt;

</description>
      <category>maths</category>
      <category>algorithms</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Scroll like you are oblivious to the browser!</title>
      <dc:creator>Priyanka Kore</dc:creator>
      <pubDate>Fri, 05 Jul 2019 15:22:10 +0000</pubDate>
      <link>https://forem.com/piyukore06/scroll-like-you-are-oblivious-of-the-browser-4j4n</link>
      <guid>https://forem.com/piyukore06/scroll-like-you-are-oblivious-of-the-browser-4j4n</guid>
      <description>&lt;p&gt;It's the age of modern apps. In these modern apps, unquestionably, we want scrollbars look and behave the same way in all the browsers and in all operating systems. Scrollbars can be an important part of the design. Look at the &lt;a href="https://css-tricks.com/" rel="noopener noreferrer"&gt;CSS Tricks&lt;/a&gt; website, how beautifully they have integrated their scrollbar as a part of their design. The web is more than 20 years old but there are still scrollbar still pretty much remains hard to style. Styling scrollbar is the poster child of CSS complaining, Why does it have to be so hard?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdb3wejhun61zdcx3weaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdb3wejhun61zdcx3weaw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we look at the solutions, first let's take a look at how scrollbars styling can be done in different browsers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Safari, Opera and Chrome (Webkit, Blink browsers)
&lt;/h3&gt;

&lt;p&gt;Webkit browsers support styling of scrollbar, you can change the track and thumb width color and a lot of other things for eg:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;::-webkit-scrollbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-track-piece&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#C2D2E4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-thumb:vertical&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#0A4C95&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a detailed list of all the &lt;code&gt;::-webkit-srollbar&lt;/code&gt; prefixed options that could be found &lt;a href="https://webkit.org/blog/363/styling-scrollbars/" rel="noopener noreferrer"&gt;here&lt;/a&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Pseudo element &lt;code&gt;::-webkit-scrollbar&lt;/code&gt; is a non-standard implementation, which allows us to modify the look of the browser's scrollbar&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Firefox (Gecko)
&lt;/h3&gt;

&lt;p&gt;As of version 64 Firefox supports the &lt;a href="https://drafts.csswg.org/css-scrollbars-1/" rel="noopener noreferrer"&gt;official scrollbar styling&lt;/a&gt; through the properties &lt;code&gt;scrollbar-color&lt;/code&gt; and &lt;code&gt;scrollbar-width&lt;/code&gt; for eg:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="nc"&gt;.scroller&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;overflow-y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;scroll&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;scrollbar-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rebeccapurple&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;scrollbar-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;thin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Details about that could be found &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There's a caveat (Curious case of disappearing scrollbar): The auto-hiding semi-transparent scrollbars that are the macOS default cannot be colored with this rule (they still choose their own contrasting color based on the background). Only the permanently showing scrollbars (System Preferences &amp;gt; Show Scroll Bars &amp;gt; Always) are colored.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well that's not pretty. There has to be a solution. Why is it so hard??&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom scrollbars
&lt;/h3&gt;

&lt;p&gt;One of the solutions can be not to use native browser scrolling. We can create our very own div where we define a js based scrolling, this way we can completely control how scrollbars look and feel. But that’s expensive, low fidelity and can feel laggy.&lt;/p&gt;

&lt;p&gt;I was looking for a scrollbar for a long time, till I found out &lt;a href="https://github.com/Grsmto/simplebar" rel="noopener noreferrer"&gt;Simplebar&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With Simplebar, we can leverage some unconventional CSS matrices to build a custom scroller that doesn’t require any JavaScript while scrolling, just some setup code.&lt;/p&gt;

&lt;p&gt;According to the Simplebar readme, For the most part SimpleBar uses the browser's native scrolling functionality, but replaces the conventional scrollbar with a custom CSS-styled scrollbar. The plugin listens for scroll events and redraws the custom scrollbar accordingly.&lt;/p&gt;

&lt;p&gt;Key to this technique is hiding the native browser scrollbar. The scrollable element is made slightly wider/taller than its containing element, effectively hiding the scrollbar from view. It uses &lt;code&gt;MutationObserver&lt;/code&gt; to listen to browser events.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get implementing
&lt;/h2&gt;

&lt;p&gt;You can take any &lt;code&gt;div&lt;/code&gt; and initialise simplebar with &lt;code&gt;new SimpleBar(document.getElementById('myId'))&lt;/code&gt;. Apart from styling there are various options available such as &lt;code&gt;autoHide&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is just so much fun to use. The only thing to keep in mind is, when you are adding a Simplebar to a div, make sure that the div has a &lt;code&gt;height&lt;/code&gt; or &lt;code&gt;width&lt;/code&gt; so that Simplebar can decide, which scrollbar to add &lt;code&gt;horizontal&lt;/code&gt; or &lt;code&gt;vertical&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Specially in case of horizontal scrollbars. Let's look at an example. Let's say we have a container. Inside we have 100 divs each of &lt;code&gt;width: 10px&lt;/code&gt;. Usually to make it scroll horizontally, we need to add some styles to the container like &lt;code&gt;width: 1000px; overflow-x: scroll;&lt;/code&gt; (of course there has to be other styles like &lt;code&gt;display: inline-block;&lt;/code&gt; etc, but that's not the focus of this article)&lt;/p&gt;

&lt;p&gt;But the problem arises if we have dynamic content. For every render we need to change the width of the div.&lt;/p&gt;

&lt;p&gt;In this case Simplebar works like a charm. All you need to do is, mention a width after surpassing that it should scroll, let's say &lt;code&gt;width: 100vw;&lt;/code&gt; &lt;br&gt;
it will make it scroll :) Simplebar also provides with a &lt;code&gt;recalculate()&lt;/code&gt; function, in case the the &lt;code&gt;MutationObserver&lt;/code&gt; doesn't pick up a change.&lt;/p&gt;

&lt;h2&gt;
  
  
  End Note
&lt;/h2&gt;

&lt;p&gt;Simplebar is just so easy, it hits clearly on the problem without messing with browser scrolling behaviour. Easy to setup and customise. There are wrappers available for &lt;code&gt;React&lt;/code&gt; and &lt;code&gt;Vue&lt;/code&gt;. And finaalllyyyy we have a cross-browser, cross platform, lightweight and performant solution to the scrollbars in modern apps.&lt;/p&gt;

&lt;p&gt;Photo by Leo Rivas on Unsplash&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>browsers</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Web Scraping 101</title>
      <dc:creator>Priyanka Kore</dc:creator>
      <pubDate>Mon, 01 Jul 2019 19:52:24 +0000</pubDate>
      <link>https://forem.com/piyukore06/web-scraping-101-g9l</link>
      <guid>https://forem.com/piyukore06/web-scraping-101-g9l</guid>
      <description>&lt;p&gt;Web scraping is a vast topic. In this article we are going to look at what it is? Where can we use it? and a basic example of how to go about it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is it?
&lt;/h3&gt;

&lt;p&gt;Web scraping is a method used by web developers to extract large amount of data from any given website. This is mostly used to save developers time in case if you want to make calculations on massive amount of data off any website so that they actually don't have to visit these sites and manually log all the data themselves.&lt;/p&gt;

&lt;p&gt;Web scraping a web page involves fetching it and extracting from it. Fetching is the downloading of a page (which is what a browser does when you view the page). Therefore, web crawling is a main component of web scraping, to fetch pages for later processing. Once fetched, then extraction can take place. The content of a page may be parsed, searched, reformatted, its data copied into a spreadsheet or save to a server, and so on. Web scrapers typically take something out of a page, to make use of it for another purpose somewhere else.&lt;/p&gt;

&lt;p&gt;There are methods that some websites use to prevent web scraping, such as detecting and disallowing bots from crawling (viewing) their pages. In response, there are web scraping systems that rely on using techniques in DOM parsing, computer vision and natural language processing to simulate human browsing to enable gathering web page content for offline parsing. For eg: Github has rate limiting mechanism to control incoming and outgoing traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Use Cases?
&lt;/h3&gt;

&lt;p&gt;Here, when we are learning about web scraping. One might think, it sounds cool and all but what do I do with it?&lt;br&gt;
Most use cases include automation of some kind. It could be any of the following &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Online price monitoring&lt;/li&gt;
&lt;li&gt;Research&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Market analysis&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to build large data sets for Machine learning&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;End to end testing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gathering real estate listings&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Product comparison websites&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Of course there doesn't have to be such a gigantic use case. Online you can find examples of developers getting creative for automating small things helping their day to day lives. One developer had built a small script for logging in and checking her loan due amount everyday, or when devs are not happy with the data representation UI provides and need some special kind of filter.&lt;/p&gt;

&lt;p&gt;Our use case for today is that we need a list of emojis saved to a JSON file with it'S unicode and name (because who doesn't love emojis). There is &lt;a href="https://unicode.org/emoji/charts/full-emoji-list.html"&gt;official list of all emoji unicodes&lt;/a&gt; on unicode.org. &lt;/p&gt;

&lt;p&gt;Note 📝: The more updated version of that lives &lt;a href="https://unicode.org/Public/emoji/12.0/"&gt;here&lt;/a&gt; but we want to learn scraping so we will stick to html. &lt;/p&gt;

&lt;h3&gt;
  
  
  🛠 Tools that can be used
&lt;/h3&gt;

&lt;p&gt;Let's go hunting for a tool that can help us do that. There are two most commonly used JS libs for scraping Cheerio and Puppeteer. Let's look at each one of them briefly&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://cheerio.js.org/"&gt;Cheerio&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Cheerio is like the most popular one. According to their website, Cheerio is a fast, flexible, and lean implementation of core jQuery designed specifically for the server. jQuery like api is what makes it a darling of devs. They have a massive list of selectors, again syntax borrowed from jQuery. Because I am not familiar with jQuery syntax as much, I decided to go with puppeteer.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="//pptr.dev"&gt;Puppeteer&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Puppeteer is Node api for Headless chrome and headless chrome is a program that node put out to be able to use their browser without a GUI. It is usually used for automating things, which is what we need. It uses &lt;a href="https://chromedevtools.github.io/devtools-protocol/"&gt;devtool protocol&lt;/a&gt;. It's really cool, in case you want to check it out.&lt;/p&gt;

&lt;p&gt;Puppeteer has event-driven architecture, which removes a lot of potential flakiness. There’s no need for &lt;code&gt;sleep(1000)&lt;/code&gt; calls in puppeteer scripts. You can play around with puppeteer &lt;a href="https://try-puppeteer.appspot.com/"&gt;here&lt;/a&gt;. And since it is actual chromium api, it is much more powerful than Cheerio. It can do things like generating PDFs, screenshots or capture timeline trace and much more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Show me the code
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install puppeeteer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;so start a new project &lt;code&gt;npm init -y&lt;/code&gt;&lt;br&gt;
install puppeteer &lt;code&gt;npm install puppeteer --save&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note 📝:  When installed, it downloads a version of Chromium, which it then drives using &lt;code&gt;puppeteer-core&lt;/code&gt;. If you install &lt;code&gt;puppeteer-core&lt;/code&gt;, it doesn't download Chromium. It requires Node version &amp;gt;&amp;gt; v6.4.0, but our example below uses async/await which is only supported in Node version &amp;gt;= v7.6.0&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launch the browser and navigate to the webpage
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;puppeteer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;headless&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://unicode.org/emoji/charts/full-emoji-list.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt; 
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When you launch Puppeteer, you get a instance of a browser back, It has all bunch of options, by default puppeteer launches a headless browser, for debugging purposes you can set headless false, then you can actually see all the things that are gonna happen with the script, but note that headless mode is faster. At the end of it you wanna close the browser, because if you don't, you gonna have memory leaks, and you don't want that.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search and get the data we need
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;puppeteer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scrape&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;headless&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://unicode.org/emoji/charts/full-emoji-list.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;table tr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.code a&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;U+&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;_&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;scrape&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// success&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If the function passed to the &lt;code&gt;page.evaluate&lt;/code&gt; returns a Promise, then &lt;code&gt;page.evaluate&lt;/code&gt; would wait for the promise to resolve and return its value.&lt;br&gt;
It's not executing this function in Puppeteer, it's actually executing that in the DOM, so you have access to all the DOM. We searched the document for all emoji unicodes and their names, and returned the data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save the data
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;puppeteer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scrape&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;headless&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://unicode.org/emoji/charts/full-emoji-list.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;table tr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.code a&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;U+&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;_&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;scrape&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;emoji-list.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DONE!!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here we just saved the returned data to a JSON file. And there you have it, the list of emojis.&lt;/p&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

&lt;p&gt;now run the script with &lt;code&gt;node index.js&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  End Note
&lt;/h3&gt;

&lt;p&gt;Web scraping is certainly a fun experience. As I mentioned it is broad field and you have finished a brief tour of that field. You can get pretty far using &lt;code&gt;puppeteer&lt;/code&gt; for scraping. &lt;/p&gt;

&lt;p&gt;I hope that this post helps with getting started with Web scraping and that you enjoyed it!&lt;/p&gt;

&lt;p&gt;If you have some questions or comments please let me know in the comments below and I will get back to you.&lt;/p&gt;

&lt;p&gt;Photo by Nick Fewings on Unsplash&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>puppeteer</category>
      <category>scraping</category>
    </item>
  </channel>
</rss>
