<?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>DEV Community: Md Abu Taher</title>
    <description>The latest articles on DEV Community by Md Abu Taher (@entrptaher).</description>
    <link>https://dev.to/entrptaher</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%2F34957%2Fd80f53a3-f81e-499a-b3da-1099dba2a79e.jpg</url>
      <title>DEV Community: Md Abu Taher</title>
      <link>https://dev.to/entrptaher</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/entrptaher"/>
    <language>en</language>
    <item>
      <title>QA: Npm scripts vs gulp or similar test runners?</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Fri, 06 Jan 2023 09:56:58 +0000</pubDate>
      <link>https://dev.to/entrptaher/qa-npm-scripts-vs-gulp-or-similar-test-runners-2bbm</link>
      <guid>https://dev.to/entrptaher/qa-npm-scripts-vs-gulp-or-similar-test-runners-2bbm</guid>
      <description>&lt;p&gt;This is a &lt;a href="https://stackoverflow.com/questions/75006407/npm-scripts-vs-gulp-or-similar-test-runners" rel="noopener noreferrer"&gt;question asked on stackoverflow&lt;/a&gt; which will most likely be closed because it's not a question asking for a straightforward solution. So I'll share it here with some context and answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Question:
&lt;/h3&gt;

&lt;p&gt;What are the advantages and disadvantages of both? I currently have npm scripts for test execution like this in package.json:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "scripts": {
    "test": "npx playwright test",
    "lint": "eslint . --ext js,ts",
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having never used gulp or grunt, I would like to know if they do have any massive advantages over just using npm scripts? Thank you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Answer:
&lt;/h3&gt;

&lt;p&gt;You've shown that running tests with npm scripts is simple. Simply run &lt;code&gt;npm run test&lt;/code&gt; from the command line to run tests.&lt;/p&gt;

&lt;p&gt;The number of npm scripts and their complexity can make them difficult to maintain. In such cases, a task runner like Gulp or Grunt can be helpful.&lt;/p&gt;

&lt;p&gt;Gulp and Grunt are JavaScript task runners that automate minification, compilation, unit testing, and linting. Both use configuration files to define tasks that can be run from the command line.&lt;/p&gt;

&lt;p&gt;Gulp or Grunt's benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;With a task runner, you can define all your tasks in a single configuration file, making them easier to manage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Task runners offer more configuration options and can run multiple commands or chain tasks together.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sharing tasks is easier with a task runner configuration file than with npm scripts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If npm scripts meet your needs, you don't need a task runner. If your npm scripts are difficult to manage, Gulp or Grunt may be a better option.&lt;/p&gt;

</description>
      <category>html</category>
      <category>webpack</category>
      <category>discuss</category>
    </item>
    <item>
      <title>State of AI and AI Content Detection</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Fri, 23 Dec 2022 01:59:57 +0000</pubDate>
      <link>https://dev.to/entrptaher/state-of-ai-and-ai-content-detection-m7h</link>
      <guid>https://dev.to/entrptaher/state-of-ai-and-ai-content-detection-m7h</guid>
      <description>&lt;p&gt;There is a post about &lt;a href="https://dev.to/devteam/guidelines-for-ai-assisted-articles-on-dev-17n6"&gt;Guidelines for AI-assisted Articles on DEV&lt;/a&gt; which lists down a few rules for posting on dev.to, and then there was my post about &lt;a href="https://dev.to/entrptaher/using-chatgpt-for-parsing-data-a-cautionary-tale-4kl1"&gt;Why you shouldn't rely on ChatGPT so much!&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The drawback of using AI to write things are getting worse. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;People are using and abusing AI to write tons of contents, flooding fiverr and upwork with writing related jobs. There are now tons of videos explaining how to earn easy money using AI to write content.&lt;/li&gt;
&lt;li&gt;Flooding stackoverflow with wrong answers to the questions, which led to a &lt;a href="https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned"&gt;ban on ChatGPT based solutions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Google also says &lt;a href="https://www.searchenginejournal.com/google-says-ai-generated-content-is-against-guidelines/444916/"&gt;AI generated contents are bad&lt;/a&gt; for SEO.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The issue with AI writing is almost similar as the issue we had with Co-Pilot. Some people abusing the machine and some are fearing it would replace human.&lt;/p&gt;

&lt;p&gt;Let's check this following section written by ChatGPT.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Artificial intelligence (AI) is revolutionizing the transportation industry by optimizing routes, schedules, and other aspects of transportation in order to improve efficiency and customer satisfaction. With the ability to analyze real-time traffic data and provide personalized recommendations and updates, AI-powered systems are making it easier for people to get from point A to point B and enhancing the overall travel experience.&lt;/p&gt;

&lt;p&gt;In addition to optimizing transportation for individuals, AI is also being used to streamline logistics and supply chain management, helping businesses and organizations to optimize their operations and reduce costs. By analyzing data on demand, inventory, and transportation, AI-powered systems can make significant improvements to the efficiency of supply chains and logistics operations.&lt;/p&gt;

&lt;p&gt;Overall, the use of AI in transportation is on the rise and is expected to continue to grow as more businesses and organizations adopt these technologies to improve efficiency and customer satisfaction.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now this is easily detected by the AI content detection tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fruxycnyvd0hn3zvhm422.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fruxycnyvd0hn3zvhm422.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I asked AI systems to rewrite it and avoid useless words. It generated a more simpler version.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Have you noticed how AI is making it easier and more fun to travel? It helps us get from one place to another faster and more comfortably by analyzing traffic data and giving us personalized recommendations.&lt;/p&gt;

&lt;p&gt;And it's not just for people like you and me - businesses use it to make their operations run smoother and save money, too. They do this by looking at data on things like demand, inventory, and transportation to simplify their logistics and supply chains.&lt;/p&gt;

&lt;p&gt;AI in transportation is becoming more popular and is expected to keep growing in the future.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And then the AI content detection failed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy4bibzrp007rmg0xni27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy4bibzrp007rmg0xni27.png" alt="Image description" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In fact there are tools like &lt;a href="https://contentatscale.ai?fpr=taher"&gt;Content at Scale&lt;/a&gt; who charges a hefty amount to provide ai content that sounds less ai-ish, as they mix up a few AI tools, google search and so on, to produce a better content. I am sure there will be more doing the same.&lt;/p&gt;

&lt;p&gt;Okay so now what? &lt;/p&gt;

&lt;p&gt;There are AI tools that can produce contents, there are AI detection tools that can detect AI contents, but both of them can be easily fooled.&lt;/p&gt;

&lt;p&gt;What is the issue here? &lt;/p&gt;

&lt;p&gt;The issue is the quality of content we are going to read on a daily basis. Since AI content is basically trained on dataset of real world data, a ton of AI content will sound real, while a ton of real human written content will end up sounding like AI. &lt;/p&gt;

&lt;p&gt;If I consume more AI related contents, I am bound to pick up a few of their habits when doing research for my articles, and end up being called an AI.&lt;/p&gt;

&lt;p&gt;So basically it's another cat and mouse game once again. People will abuse it as much as possible and there seems to be no solution at sight yet until human creativity catches up, it will for sure. If AI was trained by human, AI can be caught by human as well.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Why you shouldn't rely on ChatGPT so much!</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Wed, 21 Dec 2022 03:52:56 +0000</pubDate>
      <link>https://dev.to/entrptaher/using-chatgpt-for-parsing-data-a-cautionary-tale-4kl1</link>
      <guid>https://dev.to/entrptaher/using-chatgpt-for-parsing-data-a-cautionary-tale-4kl1</guid>
      <description>&lt;p&gt;As a developer, I'm always on the lookout for new tools and techniques that can streamline my workflow and save me time. Recently, I decided to give ChatGPT a try for web automation.&lt;/p&gt;

&lt;p&gt;My goal was to extract data from HackerNews using ChatGPT, so I fed it a series of prompts and hoped it would generate the appropriate regex for me.&lt;/p&gt;

&lt;p&gt;Oh! I was so wrong!&lt;/p&gt;

&lt;p&gt;Unfortunately, despite its impressive capabilities and hype, ChatGPT ultimately failed to deliver the goods.&lt;/p&gt;

&lt;p&gt;While it did generate some text that sounded like it might be on the right track, it didn't actually solve my problem. This was both good news and bad news. &lt;/p&gt;

&lt;p&gt;On the one hand, it showed that ChatGPT was learning and adapting to meet my needs. On the other hand, it didn't actually get the job done.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtka5tf4dg9dgijx7g0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtka5tf4dg9dgijx7g0z.png" alt="Image description" width="800" height="821"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the end, I decided to take matters into my own hands and started adjusting the generated regex myself. It took some trial and error, but eventually, I was able to get it working.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps I have taken
&lt;/h3&gt;

&lt;p&gt;I told ChatGPT that it should become a regex generator and the output should be in JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Friuq2c4zvba8ysp3dkt5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Friuq2c4zvba8ysp3dkt5.png" alt="Image description" width="800" height="574"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I simply copied and pasted the text from HackerNews.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fciy2wwnpvi3mz0eefg4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fciy2wwnpvi3mz0eefg4b.png" alt="Image description" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide ChatGPT with the desired input and output for the regex.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqnhh3do98xjjwwt6x4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqnhh3do98xjjwwt6x4p.png" alt="Image description" width="800" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I received a sample output from ChatGPT, and it sounded like it was absolutely accurate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptn9wsto74vej4lphups.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptn9wsto74vej4lphups.png" alt="Image description" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To validate it, I took it to regex101, which would highlight everything for me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzaqo9577s1f6hup8fy4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzaqo9577s1f6hup8fy4.png" alt="Image description" width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It looks like it worked, except for one result. So I went back to ChatGPT and provided more information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzg9dwliobo41n4ocrkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzg9dwliobo41n4ocrkw.png" alt="Image description" width="800" height="632"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But instead of fixing it, it just broke the whole regex. Everything, including time, is now broken.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmm70ts0985ulfdf5zgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmm70ts0985ulfdf5zgt.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I continued to iterate on this process, using ChatGPT’s output as a starting point and making manual adjustments until the desired regex was obtained.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k2l3t92n4skgw0hv4fj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k2l3t92n4skgw0hv4fj.png" alt="Image description" width="800" height="763"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, this process needed a lot of tries, which used up my precious credits that I could spend on other things.&lt;/p&gt;

&lt;p&gt;¯_(ツ)_/¯&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehfx52xt4fdgyuay5zl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehfx52xt4fdgyuay5zl1.png" alt="Image description" width="800" height="623"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I decided to take matters into my own hands and tweak the regex myself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fem35yjmlkgz8yhri1j2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fem35yjmlkgz8yhri1j2k.png" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The final regex was this, which worked for most stories.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;^(?&amp;lt;rank&amp;gt;\d+)\.\s+(?&amp;lt;title&amp;gt;.+)\s+\((?&amp;lt;site&amp;gt;.+)\)\s+(?&amp;lt;points&amp;gt;\d+)?\s+points?\s+by\s+(?&amp;lt;author&amp;gt;\S+)?\s+(?&amp;lt;time&amp;gt;.+?)\s+\|\s+hide(\s+\|\s+(?&amp;lt;comments&amp;gt;\d+)\s+comments)?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion of the experiment
&lt;/h3&gt;

&lt;p&gt;Even though there are hundreds of other ways to grab the data from HackerNews, using AI to extract data from a blob of text was an interesting challenge to try with ChatGPT. But this experiment just told me one thing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do not blindly trust GPT and variants. It can give you incorrect data with very high confidence and your precious app will be broken in no time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay, I could have given it better input, but keep in mind that I tried this process many times with different input. Meanwhile, it kept adding big blobs of text to the response, even when I didn’t need them. I've noticed that it frequently adds large blobs of text despite my requests.&lt;/p&gt;

&lt;p&gt;For example, this prompt specifically mentions avoiding providing explanation, but who cares?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j5tzn92veq2atmnkrxc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j5tzn92veq2atmnkrxc.png" width="800" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What does ChatGPT have to say about this?
&lt;/h3&gt;

&lt;p&gt;I told ChatGPT about the above situation, and it sympathized with me.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’m glad you found ChatGPT to be a helpful tool in your workflow, even if it didn’t quite solve the problem you were working on. It’s important to remember that large language models like ChatGPT, while extremely powerful and versatile, still have limitations when it comes to certain tasks.&lt;/p&gt;

&lt;p&gt;In your case, using a large language model for web automation was a novel approach, and it’s not surprising that it didn’t work perfectly on the first try. Web automation can be a complex task that requires a deep understanding of web technologies, as well as specific domain knowledge about the sites and data you are trying to access. In these cases, it’s often best to use specialized tools or rely on your own expertise and understanding of the problem.&lt;/p&gt;

&lt;p&gt;That being said, it’s always worth considering whether a large language model could be helpful in solving a specific problem. They can be a powerful tool in the right context, and with the right amount of training and guidance, they can learn and adapt to new tasks and environments. The key is to use them in a way that complements your own skills and knowledge, rather than relying on them as a replacement.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;This taught me about ChatGPT's limitations. Even though they can write text that sounds human, do a wide range of tasks, and speak many languages, they may not have the technical expertise to do a specific task as well as a specialized tool or a person with expertise in that area.&lt;/p&gt;

&lt;p&gt;My own knowledge and skills helped me solve the problem, not ChatGPT. This shows why language models need human understanding and expertise. Large language models can be helpful, but they shouldn't replace human understanding.&lt;/p&gt;

&lt;p&gt;You should not depend too much on ChatGPT.&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Reflections on My 15 Year Journey from Novice to Intermediate Developer</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Tue, 13 Dec 2022 06:02:50 +0000</pubDate>
      <link>https://dev.to/entrptaher/reflections-on-my-15-year-journey-from-novice-to-intermediate-developer-pje</link>
      <guid>https://dev.to/entrptaher/reflections-on-my-15-year-journey-from-novice-to-intermediate-developer-pje</guid>
      <description>&lt;p&gt;My self-taught development journey started around 15 years ago when I was a little kid. It went from passion to a job to irritation with tons of ups and downs. &lt;/p&gt;

&lt;p&gt;I became a normal developer, freelancer, co-founder, office employee and so on. Sometimes I was spending 20 hours per day in front of computer like crazy due to excitement, sometimes I got burned out from overworking and stress. &lt;/p&gt;

&lt;p&gt;I probably did not see everything, but I want to share a few points.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How do you spot a beginner programmer?&lt;/li&gt;
&lt;li&gt;Things beginners should know&lt;/li&gt;
&lt;li&gt;Things beginners should avoid&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you spot a beginner programmer?
&lt;/h2&gt;

&lt;p&gt;Top ⤴️ &lt;/p&gt;

&lt;p&gt;There are several signs that can indicate that a programmer is a beginner. Some of these signs include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lack of familiarity with core programming concepts and best practices.&lt;/li&gt;
&lt;li&gt;Struggling to write clean, well-structured, and efficient code.&lt;/li&gt;
&lt;li&gt;Reliance on copying and pasting code from online sources without fully understanding how it works.&lt;/li&gt;
&lt;li&gt;Difficulty troubleshooting and debugging errors and problems in their code.&lt;/li&gt;
&lt;li&gt;Limited knowledge of programming languages and tools.&lt;/li&gt;
&lt;li&gt;Lack of experience working on real-world projects or in a team environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are just some of the potential signs that a programmer may be a beginner. It's important to note that being a beginner is not necessarily a bad thing - everyone has to start somewhere, and everyone has different levels of experience and expertise. &lt;/p&gt;

&lt;p&gt;However, if you notice some of these signs in a programmer, it may indicate that they are still in the early stages of learning and may need more guidance and support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things beginners should know
&lt;/h2&gt;

&lt;p&gt;Top ⤴️ &lt;/p&gt;

&lt;p&gt;Here are a few tips I'd like to give to someone who is just starting to learn how to code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start by making sure that each project or task has clear goals that can be reached.&lt;/strong&gt; &lt;br&gt;&lt;br&gt;
This can help you focus your work and keep you from getting distracted by code that isn't important.&lt;br&gt;&lt;br&gt;
Use tools like Notion, ClickUp, Github Issue.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Figure out which tasks and features are most important&lt;/strong&gt; and work on them first.&lt;br&gt;&lt;br&gt;
This can help you make progress on your projects and meet your deadlines while still giving you time to try out new ideas.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ask programmers with more experience&lt;/strong&gt; for feedback and help.&lt;br&gt;&lt;br&gt;
This can help you figure out where you might be spending too much time on code that isn't necessary or useful and teach you how to work more efficiently.&lt;br&gt;&lt;br&gt;
Check Github Issues, Stackoverflow, Dev.to, Facebook Groups.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use tools and methods to better &lt;strong&gt;keep track of your time and tasks.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This can be done by using project management software, using agile development methods, or following other best practices for efficient and effective programming.&lt;br&gt;&lt;br&gt;
Use tools like DeskTime, TimeDoctor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Take breaks&lt;/strong&gt; often and don't work for long stretches without stopping.&lt;br&gt;&lt;br&gt;
This can help you avoid getting burned out at work and keep your mind on the task at hand.&lt;br&gt;&lt;br&gt;
Pomodoro is a great method to do it.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don't refactor unless needed&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
Rewriting or refactoring code can be a good way to improve how easy it is to read, how easy it is to fix, or how fast it runs. But it can take a lot of time and might not always be necessary.&lt;br&gt;&lt;br&gt;
Before starting a big refactoring project, you should carefully consider whether it will bring real benefits. You shouldn't make changes just to make changes.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Work with other programmers&lt;/strong&gt; and talk to them.&lt;br&gt;&lt;br&gt;
As a beginner, you can learn a lot from other programmers who know more than you do or have more experience.&lt;br&gt;&lt;br&gt;
By working on projects together, sharing ideas and code, and giving each other feedback and help, you can learn and grow as a programmer more quickly.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use version control&lt;/strong&gt; to manage your code.&lt;br&gt;&lt;br&gt;
Version control software, like Git, lets you keep track of changes to your code, work with other people on it, and revert to older versions if you need to.&lt;br&gt;&lt;br&gt;
This can help you organize, speed up, and keep your work safe. It can also help you avoid losing important code or making mistakes.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Put together a portfolio&lt;/strong&gt; of your work to show possible employers.&lt;br&gt;&lt;br&gt;
When you're just starting out as a programmer, it can be hard to get your first job or project.&lt;br&gt;&lt;br&gt;
Building a portfolio of your work is one way to stand out and show off your skills to potential employers or clients.&lt;br&gt;&lt;br&gt;
This can include finished projects, samples of your code, or other examples of your work that show your skills and potential.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep learning&lt;/strong&gt; new things about programming and keeping up with the latest changes (that is relevant to your goal).&lt;br&gt;&lt;br&gt;
Programming is a field that is always changing, so there are always new languages, frameworks, tools, and methods to learn. You can keep getting better as a programmer and stay ahead of the curve in a field that is getting more and more competitive by staying curious and up-to-date.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write clean and readable code.&lt;/strong&gt; &lt;br&gt;&lt;br&gt;
As a beginner programmer, you might be tempted to just focus on getting your code to work and not think about how easy it is to read or fix. But writing code that is clean and easy to read is important for more than one reason.&lt;br&gt;&lt;br&gt;
It can make your code easier to understand and change, which can save you time and effort in the long run. It can also make your code easier to find and use, which can be helpful when working with other programmers or putting your code into larger systems.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write a lot of tests.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Testing is an important part of the development process, and it can help you find bugs and fix them.&lt;br&gt;&lt;br&gt;
By writing and running tests, you can make sure that your code works the way you want it to, and you can find and fix any problems before they get worse.&lt;br&gt;&lt;br&gt;
This can save you time, effort, and frustration and help you give your users or clients better-quality code.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Take care of both &lt;strong&gt;your body and your mind.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Programming can be hard on both your mind and body. It can take long hours of focusing, solving problems, and working with other people, which can be hard on your body and mind.&lt;br&gt;&lt;br&gt;
Taking care of yourself is important if you want to avoid burnout and keep working well. Getting enough sleep, working out regularly, eating well, and taking breaks from your work are all ways to do this.&lt;br&gt;&lt;br&gt;
Taking care of your health will allow you to remain focused, energized, and motivated, allowing you to be a better programmer.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learn how to debug&lt;/strong&gt; your code.&lt;br&gt;&lt;br&gt;
Debugging is an important part of development that every programmer needs to know how to do.&lt;br&gt;&lt;br&gt;
By learning to find and fix errors and bugs in your code, you can make it more reliable and faster, and you won't waste time on code that doesn't work the way you want it to.&lt;br&gt;&lt;br&gt;
There are many tools and methods you can use to fix bugs in your code. If you want to become a better programmer, you should learn and practice these skills.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stick to the rules and best practices&lt;/strong&gt; for coding.&lt;br&gt;&lt;br&gt;
If you're just starting out as a programmer, you might not know the rules and best practices for writing code in your language or field.&lt;br&gt;&lt;br&gt;
It's important to learn and follow these standards and best practices because they can help you write code that is easier to read, maintain, and use.&lt;br&gt;&lt;br&gt;
They can also help you avoid common mistakes and pitfalls, and they can make it easier for other programmers to understand and use your code.&lt;br&gt;&lt;br&gt;
By following coding standards and best practices, you can improve the quality of your code and make it more useful to you and others.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Take on projects and problems&lt;/strong&gt; that are hard.&lt;br&gt;&lt;br&gt;
If you're just starting out as a programmer, you might be tempted to take on only small or easy projects so you don't get too busy or frustrated.&lt;br&gt;&lt;br&gt;
But it's important to push yourself and take on bigger, harder projects, because that's how you'll learn the most and grow as a programmer.&lt;br&gt;&lt;br&gt;
You can improve your skills, gain confidence, and build a body of work you can be proud of by taking on hard problems and overcoming obstacles.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be proactive and take initiative.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Don't just wait for someone to tell you what to do. Look for opportunities to learn and grow, and take on new challenges.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Google everything.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Learn how to google, watch videos and tutorials, visit stackoverflow and reddit. But never copy a code block without understanding how it works.&lt;br&gt;&lt;br&gt;
Also, set yourself a time limit on googling stuff before asking other senior developers.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Things beginners should avoid
&lt;/h2&gt;

&lt;p&gt;Top ⤴️ &lt;/p&gt;

&lt;p&gt;Here are some things that a new programmer should not do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ignore the latest trends&lt;/strong&gt; or fads in the field of programming.&lt;br&gt;&lt;br&gt;
The world of programming is constantly changing, and there are always new languages, frameworks, tools, and techniques to learn.&lt;br&gt;&lt;br&gt;
However, not all of these developments are equally valuable or relevant, and it can be a waste of time and effort to chase after every new trend or fad.&lt;br&gt;&lt;br&gt;
Instead, focus on the fundamental concepts and principles of programming, and learn the tools and techniques that are most relevant and useful for your goals and projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ignore the pressure to be a perfect&lt;/strong&gt; programmer.&lt;br&gt;&lt;br&gt;
As a beginner, it is natural to feel pressure to be perfect, to avoid making mistakes, or to measure up to the standards of more experienced programmers.&lt;br&gt;&lt;br&gt;
However, perfection is unattainable, and it is more important to focus on learning and improving.&lt;br&gt;&lt;br&gt;
Be willing to make mistakes, to learn from them, and to continue to grow and develop as a programmer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ignore the temptation to compare&lt;/strong&gt; yourself to others.&lt;br&gt;&lt;br&gt;
As a beginner, it can be easy to compare yourself to other programmers who may have more experience, more skills, or more success than you do.&lt;br&gt;&lt;br&gt;
However, comparisons are rarely useful, and they can be damaging to your confidence and motivation.&lt;br&gt;&lt;br&gt;
Instead, focus on your own goals and progress, and celebrate your own achievements, no matter how small they may seem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ignore the voices&lt;/strong&gt; that tell you that you are not good enough or that you can't do it.&lt;br&gt;&lt;br&gt;
As a beginner programmer, you may encounter many voices that tell you that you are not good enough, that you don't have the right skills or knowledge, or that you should give up.&lt;br&gt;&lt;br&gt;
These voices can come from many sources, including your own doubts, the expectations of others, or the challenges of the field. It is important to ignore these voices and to believe in yourself and your abilities.&lt;br&gt;&lt;br&gt;
You have the potential to become a successful and skilled programmer, and you can achieve your goals if you are willing to put in the effort and dedication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ignore the temptation to overcomplicate&lt;/strong&gt; your solutions.&lt;br&gt;&lt;br&gt;
As a beginner programmer, you may be tempted to overcomplicate your solutions, to add unnecessary features or enhancements, or to try to impress others with your code.&lt;br&gt;&lt;br&gt;
However, simple and straightforward solutions are often the best, and they can be more efficient, maintainable, and effective than complex and sophisticated solutions.&lt;br&gt;&lt;br&gt;
By focusing on the core requirements and avoiding unnecessary complications, you can write code that is more valuable and useful to yourself and others.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ignore the fear of failure.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
As a beginner programmer, you may be afraid of failing, of making mistakes, or of not meeting the expectations of others.&lt;br&gt;&lt;br&gt;
This fear can hold you back and prevent you from taking risks, from exploring new ideas, or from challenging yourself. It is important to ignore this fear and to embrace failure as an opportunity to learn and grow.&lt;br&gt;&lt;br&gt;
By learning from your mistakes and failures, you can become a better programmer, and you can develop the resilience and persistence that are essential for success in the field.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As a beginner, it can be hard to take advice, even if the person giving it means well. But if you can keep going and do what experienced people tell you to do, you'll get better faster than you thought possible. So don't be afraid to take that step and try something new.&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>Front-end Challenge: Prevent Clicks</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Wed, 29 May 2019 18:45:36 +0000</pubDate>
      <link>https://dev.to/entrptaher/front-end-challenge-prevent-clicks-38ol</link>
      <guid>https://dev.to/entrptaher/front-end-challenge-prevent-clicks-38ol</guid>
      <description>&lt;p&gt;This is a challenge for frontend developers. Test your DOM manipulation and CSS skills.&lt;/p&gt;

&lt;p&gt;Create two functions, &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;addBlocker()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Should block all clicks on the page. Nothing should be clickable anymore.&lt;/li&gt;
&lt;li&gt;Should print the current mouse position on viewport, and the current element under the mouse on click.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;removeBlocker()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Should remove the blocker created by addBlocker(), everything should be clickable as before adding the blocker.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The two functions should work on any website including, &lt;a href="http://dev.to"&gt;dev.to&lt;/a&gt; and &lt;a href="http://producthunt.com"&gt;producthunt.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is a video preview of what should be done.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ZkVPheXNqoc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Share your code in the comment section or in a github gist.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Scraping infinite loading (ie: Product Hunt) pages! Without using ajax!</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Wed, 29 May 2019 00:36:20 +0000</pubDate>
      <link>https://dev.to/vanila-io/scraping-infinite-loading-ie-product-hunt-pages-without-using-ajax-6e5</link>
      <guid>https://dev.to/vanila-io/scraping-infinite-loading-ie-product-hunt-pages-without-using-ajax-6e5</guid>
      <description>&lt;p&gt;If you are into building web scrapers, you know how hard it's to scrape infinite loading pages. Most search results you see on google focuses on two methods.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find the ajax on network tab, try to scrape from it.&lt;/li&gt;
&lt;li&gt;Use a combination of &lt;code&gt;document.body.scrollHeight&lt;/code&gt;, &lt;code&gt;window.scrollTo&lt;/code&gt; and some for loop.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feahe4d1yubbvcf1ttmfk.png" width="800" height="701"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Unfortunately most of them does not work well with lazy loading images, or pages where infinite loading is triggered by &lt;strong&gt;smooth scrolling&lt;/strong&gt;. Fiddling with network tab also seems counter productive in many cases and easily triggered as a bot on some websites.&lt;/p&gt;

&lt;p&gt;I was thinking of a solution for this for few years. Tried all different ways and got disappointed because it varied a lot between websites.&lt;/p&gt;

&lt;p&gt;Finally it kicked me when I was updating &lt;a href="https://stackoverflow.com/a/52671691/6161265" rel="noopener noreferrer"&gt;this&lt;/a&gt; and &lt;a href="https://stackoverflow.com/a/56349839/6161265" rel="noopener noreferrer"&gt;this&lt;/a&gt; on stackoverflow. Feel free to explore them.&lt;/p&gt;

&lt;p&gt;Here is the small preview of what we will be building today. It’s a one minute video (sorry, no audio).&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hUNeD4TMwbk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Case:
&lt;/h1&gt;

&lt;p&gt;You need to scrape 100 results from product hunt. The result should contain post title and image url in following structure. It has to stop scraping once the limit has been reached or there are no element left.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Some product title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"img"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://ph-files.imgix.net/123456-abcdefghijkl"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be using the surefire method called &lt;code&gt;window.scrollTo&lt;/code&gt;, but not with &lt;code&gt;document.body.scrollHeight&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Solution:
&lt;/h1&gt;

&lt;p&gt;PS: If you want to read the code, jump to the final code.&lt;/p&gt;

&lt;p&gt;Here what we will do,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will extract the selector (obviously 🤷).&lt;/li&gt;
&lt;li&gt;Then we will find the first element on the page for that selector. We won't continue if there are no element.&lt;/li&gt;
&lt;li&gt;Scroll the element into view.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optional!&lt;/strong&gt; Wait for a few milliseconds to let it load images and vice versa.&lt;/li&gt;
&lt;li&gt;Extract information from that element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Important!&lt;/strong&gt; Remove the element from dom.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Important!&lt;/strong&gt; Scroll to top of the page.&lt;/li&gt;
&lt;li&gt;Do the next element or stop if limit has been reached.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The steps marked as &lt;strong&gt;IMPORTANT&lt;/strong&gt; are the key. They will trigger the scroll event on the page without even scrolling manually like others do with &lt;code&gt;document.body.scrollHeight&lt;/code&gt; and so on.&lt;/p&gt;

&lt;p&gt;Alright, now that you know the solution, you can code the rest of it from the video above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlctbbb3kpd0m4cejqzs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlctbbb3kpd0m4cejqzs.jpg" width="460" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm kidding 😅! Here are the steps!&lt;/p&gt;

&lt;h2&gt;
  
  
  Extracting the selectors
&lt;/h2&gt;

&lt;p&gt;You probably did this lots of time. But here is a short recap anyway. I will not be writing the selectors directly here because they might change by the time you are reading this post.&lt;br&gt;
Open chrome and load producthunt page. Then right click on a title.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05mok8l27axjefw3kyc8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05mok8l27axjefw3kyc8.png" width="648" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now pick any of these classes. We will find the right one on next step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n3joail73ace196lsgs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n3joail73ace196lsgs.png" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Write down the class name on the console. It will do a instant evaluation, so you will know if the selector is correct or not right away.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0j1faxsyxne87r4ayxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0j1faxsyxne87r4ayxi.png" width="608" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we have 27 results, we are probably on the right path. Since there are more or less 20-30 results when you load the page first time.&lt;/p&gt;

&lt;p&gt;Alright, next we can extract the selector for image.&lt;/p&gt;

&lt;p&gt;Fortunately for us, the selector for image is even more straightforward, because we have a nice data attribute there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ax55ebffz8veuhneh4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ax55ebffz8veuhneh4n.png" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, if you tweak the selector a bit, you will see there are 25 results out of 27 products. Which means it did not load the last two images.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbqonxz5fyaf00e39v2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbqonxz5fyaf00e39v2o.png" width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you scrapped this page right now, you would have 25 proper results.&lt;br&gt;
Additionally I extracted the parent element for each product listing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffx96s6zkcndjdh4uryd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffx96s6zkcndjdh4uryd6.png" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I see something bit weird, it says 34 results. Which means it did not even load the last 7 results. Not even the title. It's there but not loaded at the moment.&lt;/p&gt;

&lt;p&gt;Finally we have three selectors.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product Entry (Optional): &lt;code&gt;div.white_09016 ul li&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Title: &lt;code&gt;.title_9ddaf&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Image: &lt;code&gt;[data-test="post-thumbnail"] img&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These selectors can change any time since it's a react based website.&lt;/p&gt;
&lt;h2&gt;
  
  
  Scrape the data
&lt;/h2&gt;

&lt;p&gt;You can execute these code on the browsers console or using some script/library ie: puppeteer has a &lt;code&gt;page.evaluate&lt;/code&gt; method for executing functions. I will be using &lt;a href="https://chrome.google.com/webstore/detail/scratch-js/alploljligeomonipppgaahpkenfnfkn" rel="noopener noreferrer"&gt;Scratch JS&lt;/a&gt; to run the code on the page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grab Single Product&lt;/strong&gt;&lt;br&gt;
Let's create an async function called &lt;code&gt;scrollAndExtract&lt;/code&gt; which accepts two parameters called &lt;code&gt;selector&lt;/code&gt; and &lt;code&gt;leaf&lt;/code&gt;. Leaf is the &lt;code&gt;innerText&lt;/code&gt; and &lt;code&gt;src&lt;/code&gt; etc.&lt;/p&gt;

&lt;p&gt;We need &lt;code&gt;async&lt;/code&gt; because we will be using a delay inside the function for showcase purpose.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;scrollAndExtract&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;leaf&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;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selector&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;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scrollIntoView&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;element&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;leaf&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;Let’s run it,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&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="s2"&gt;innerText&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&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="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&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="s2"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5eruu0v39ci3dfijf2b1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5eruu0v39ci3dfijf2b1.png" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cool! We got the first title and image url.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scroll and Remove the element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next we will remove the element from the view. We can do this in a simpler manner by adding another parameter and tweaking our function for a bit.&lt;/p&gt;

&lt;p&gt;Let’s add a &lt;code&gt;remove&lt;/code&gt; parameter. If it’s provided, we will remove the element instead of extracting the data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;scrollAndExtract&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;remove&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;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selector&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;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scrollIntoView&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;remove&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;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;-- Remove and exit&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;leaf&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;Let’s test it out,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&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="s2"&gt;innerText&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&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="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;The product title vanished,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tdt0t78t6gi6s3x36qk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tdt0t78t6gi6s3x36qk.png" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scrape the image&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we can scrape the image as well in similar fashion.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&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="s2"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&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="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&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="s2"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;This will extract the src attribute from the image.&lt;/p&gt;

&lt;p&gt;Both of them can be merged into a single function which returns an object. We can push it to an array later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;extractor&lt;/span&gt;&lt;span class="p"&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;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&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="s2"&gt;innerText&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&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="s2"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;img&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;Let’s test it out,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;extractor&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;then&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzatwp3ie6o7fxgsnwom8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzatwp3ie6o7fxgsnwom8.png" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optional: Remove parent container for the title and image&lt;/strong&gt;&lt;br&gt;
Let’s remove the parent element after scraping the title.&lt;/p&gt;

&lt;p&gt;This is optional because the logic will work even without this. But it will save us some space on the viewport and memory as well since we are removing the dom element.&lt;/p&gt;

&lt;p&gt;We can remove the parent container and won’t have to worry about removing image or title element since it will be removed as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;extractor&lt;/span&gt;&lt;span class="p"&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;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&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="s2"&gt;innerText&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;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&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="s2"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// remove the parent here&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div.white_09016 ul li&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;img&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;It should work flawlessly,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6vjud3odmez5sffgdy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6vjud3odmez5sffgdy2.png" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Loop through 100 elements&lt;/strong&gt;&lt;br&gt;
We won’t be using a traditional for loop. We will use recursion instead.&lt;/p&gt;

&lt;p&gt;Let’s create another function to go through the elements one by one. We will store the results in a result array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;products&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&lt;/span&gt;&lt;span class="p"&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;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;extractor&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="o"&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;title&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&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;img&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&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;This will grab the first hundred elements for us. Not only that, it will stop the loop if there are no results from extractor.&lt;/p&gt;

&lt;p&gt;We can peek into &lt;code&gt;products&lt;/code&gt; array to grab our results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;hundredProducts&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiuxzj72ee9qchh0z0mhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiuxzj72ee9qchh0z0mhu.png" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And bam!&lt;/p&gt;

&lt;p&gt;We got 7 results!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Friypujak2b7u4v1kjm4d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Friypujak2b7u4v1kjm4d.png" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wait! Wut?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding small delay to lazily loaded product data with images&lt;/strong&gt;&lt;br&gt;
As you can see, we got only 7 results. That’s because we told it to stop the loop if there are no image/title. It scrolled too fast to trigger any scroll event and loading new data.&lt;/p&gt;

&lt;p&gt;Let’s use a simple delay function, which will wait for a bit before running the loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;delay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, optionally we will scroll to top of the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;products&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&lt;/span&gt;&lt;span class="p"&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;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Let's wait 0.5 seconds before moving to next one&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// also trigger a scroll event just in case&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scrollTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;extractor&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="o"&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;title&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&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;img&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&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;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvku6p6vx6i1hki2eswnz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvku6p6vx6i1hki2eswnz.png" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Result&lt;/strong&gt; &lt;a id="final-code"&gt;&lt;/a&gt;&lt;br&gt;
Alright! It’s been a long post and now we have a script and logic to scrape infinity scrolling pages like producthunt.&lt;/p&gt;

&lt;p&gt;Here is the complete code which you can run on your browsers console. Make sure un-comment the line to run &lt;code&gt;hundredProducts()&lt;/code&gt; and then log &lt;code&gt;products&lt;/code&gt; array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;delay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;d&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;scrollAndExtract&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;leaf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;remove&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;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selector&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;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scrollIntoView&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;remove&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;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;-- Remove and exit&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;leaf&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;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;extractor&lt;/span&gt;&lt;span class="p"&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;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.title_9ddaf&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="s2"&gt;innerText&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;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[data-test="post-thumbnail"] img&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="s2"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// remove the parent here&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;scrollAndExtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div.white_09016 ul li&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="p"&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;products&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&lt;/span&gt;&lt;span class="p"&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;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&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="nf"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scrollTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;extractor&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="o"&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;title&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&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;img&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&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="c1"&gt;// hundredProducts().then(() =&amp;gt; console.log(products))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Optional: Puppeteer script
&lt;/h2&gt;

&lt;p&gt;If you want to automate this with puppeteer you can put the code inside a &lt;code&gt;page.evaluate&lt;/code&gt; function. Here is a snippet and here is the &lt;a href="https://github.com/entrptaher/plaground-scrape-infinity-load" rel="noopener noreferrer"&gt;&lt;strong&gt;git repo&lt;/strong&gt;&lt;/a&gt; with complete code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&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="nf"&gt;launch&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="nf"&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="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://www.producthunt.com&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;productList&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="nf"&gt;evaluate&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="c1"&gt;// paste the final code here&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="c1"&gt;// run the function to grab data&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;hundredProducts&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// and return the product from inside the page&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;products&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="nf"&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;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;This looks ten times bigger than all other posts on the internet. But you know the original version above is a lot smaller as well. No crazy scroll to height or else.&lt;/p&gt;

&lt;p&gt;But hopefully I was able to show you a different way than how you normally scrape. Feel free to fiddle and experiment with the data.&lt;/p&gt;

&lt;p&gt;Let me know what do you think of this method and what you think is the best method out there for scraping infinity scrolling pages in general.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How NOT to ask for help</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Fri, 05 Apr 2019 19:41:23 +0000</pubDate>
      <link>https://dev.to/entrptaher/how-not-to-ask-for-help-37o2</link>
      <guid>https://dev.to/entrptaher/how-not-to-ask-for-help-37o2</guid>
      <description>&lt;p&gt;&lt;a href="https://stackoverflow.blog/2018/04/26/stack-overflow-isnt-very-welcoming-its-time-for-that-to-change/" rel="noopener noreferrer"&gt;Stack Overflow Isn’t Very Welcoming&lt;/a&gt;. However an environment does not become toxic on it's own. The people who uses the platform along with unwritten laws keeps making things worse for developers and newbies. &lt;/p&gt;

&lt;p&gt;Everyone knows about it, them too!&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%2Fi.imgur.com%2FItw7d2V.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%2Fi.imgur.com%2FItw7d2V.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One thing before I continue,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;IF YOU’RE A BEGINNER, JUST IGNORE THE TOXIC WORDS.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every now and then I would review and answer questions on stackoverflow regarding web scraping and puppeteer. And I know how much toxic stackoverflow can be.&lt;/p&gt;

&lt;p&gt;Me? No I am not Jon Skeet, I am just a small human with mere 5k reputation on SO. Many doesn't even know my name. &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%2Fi.imgur.com%2FdUt7agI.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%2Fi.imgur.com%2FdUt7agI.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The toxic environment is on both side. Newbies feels overwhelmed. However I can certainly feel the rules and regulations are there to stop wasting everyone's time. Everything you write on stackoverflow will help someone in future just like someone else's answer helps you.&lt;/p&gt;

&lt;p&gt;If you want to ask for help, be prepared to get rejected. You have to learn through rejection. Maybe your question will be bad, maybe it's already answered many times before. &lt;/p&gt;

&lt;p&gt;This applies to any and every platform, no matter how newbie-friendly they are, it's chaotic whenever there are thousands of people involved. This also does not mean the platform is toxic. There are happy and grateful people who asks valid questions and get proper answer.&lt;/p&gt;

&lt;p&gt;Here are some important points to avoid when asking for help.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Can you please write the whole damn code for me?"
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;QUESTION: I have Javascript puppeteer code, and PuppeteerSharp for C#. I know that this libraries are similar, and i know their sites. But my problem that i barely can manage this libraries, there are alot of methods for each lib, and it hard to find needed methods, even i have working example written on JS. &lt;strong&gt;Please help me rewrite JS code to C#&lt;/strong&gt;, so it would do similar things. Or at least function names, for example JS (puppeteer) method = C# (puppeteerSharp) method.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This question asks for help. It's good that they asked for help, asking takes courage. However, no, the people on the internet does not have time or will to work for free. You need to find a very specific problem and ask about it. &lt;/p&gt;

&lt;h2&gt;
  
  
  "I cannot share my code nor my research done till now. Heck I cannot even share my problem."
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2F9Aqh37n.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/http%3A%2F%2Fi.imgur.com%2F9Aqh37n.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kindly no! Please do share what you did till now! Please tell us where you stuck. We do not know mind reading. We need to understand what's wrong and how we can help.&lt;/p&gt;

&lt;p&gt;It shows us your research and effort. We are more willing to help those who works hard. Your research will help you and others who comes to same problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Can you solve all problems I mentioned?"
&lt;/h2&gt;

&lt;p&gt;All questions on same page,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why it shows infinite while loop?&lt;/li&gt;
&lt;li&gt;What is promise.all?&lt;/li&gt;
&lt;li&gt;Where do I get $$?&lt;/li&gt;
&lt;li&gt;How to get outerHTML?&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these shows us you did not do a single research, took a big project/task you were not supposed to take and feeling overwhelmed.&lt;/p&gt;

&lt;p&gt;Actually it's better if you can break your problem into multiple chunks. Do not bombard the whole page with questions, you will get downvoted right away. If you split the problems into pieces, it will help others know exactly where to help. Maybe multiple people will help about multiple sub-topics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Yes, that's all. Internet is full of toxic people. And if you want to learn within that, you need to know &lt;strong&gt;how to ask for help&lt;/strong&gt;,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do your research.&lt;/li&gt;
&lt;li&gt;Ask very specific questions.&lt;/li&gt;
&lt;li&gt;Value time, yours and others.&lt;/li&gt;
&lt;li&gt;Respect people.&lt;/li&gt;
&lt;li&gt;Share your knowledge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have fun programming!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>healthydebate</category>
    </item>
    <item>
      <title>The Reading List Hoarding Problem</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Wed, 20 Mar 2019 13:49:39 +0000</pubDate>
      <link>https://dev.to/entrptaher/the-reading-list-hoarding-problem-27jj</link>
      <guid>https://dev.to/entrptaher/the-reading-list-hoarding-problem-27jj</guid>
      <description>&lt;p&gt;Do you like to click that shiny &lt;strong&gt;[SAVE]&lt;/strong&gt; button all the time? This post might be for you.&lt;/p&gt;

&lt;p&gt;Here is the current situation of reading list on dev.to,&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw1vliiyx5dd4114tbr1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw1vliiyx5dd4114tbr1.png" alt="Dev.to" width="345" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: When I first started writing this article, it was 328, now it's 356 😱, how can I write a post that I myself cannot get rid of? Well friend, I have a reading list hoarding issue at this moment of writing that I want to get rid of. This article is dedicated to me. I just want to share my experience.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Same goes to my bookmark tab, there are at least 2k+ bookmarks there.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foal033qcwwrka02t5luq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foal033qcwwrka02t5luq.png" alt="Bookmark tab" width="511" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is current situation of pocket,&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u0fe7ilvmk254s3mc84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u0fe7ilvmk254s3mc84.png" alt="Pocket" width="800" height="663"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hashnode also has overused bookmark feature:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5qi3wiupmydvlay4ulqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5qi3wiupmydvlay4ulqc.png" alt="Hashnode" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have had feeds, pinterest, medium, facebook saved posts, and hundreds of other solutions just to save something for later.&lt;/p&gt;

&lt;p&gt;If I remember, I bought books, courses, tutorials, collected them in hundreds of folders, just like the reading list hoarding, and the time I finish my reading list? It doesn't come ever. I simply forget to read them later because I have a busy life.&lt;/p&gt;

&lt;p&gt;Anywhere from 2% to 6% of adults have hoarding disorder. Yes, this is a disorder and it exists even on the internet in my opinion.&lt;/p&gt;

&lt;p&gt;Thus, we need to talk about it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Types of hoarders
&lt;/h1&gt;

&lt;p&gt;There are few types of hoarders and you might be one of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  "I might read it later" Hoarder
&lt;/h3&gt;

&lt;p&gt;Some reader has a good collection, all sorted out properly consisting of titles they have been dying to read. However, some of these readers completely forget the existence of their previous list as soon as they see another awesome/popular post/media. &lt;/p&gt;

&lt;p&gt;Once they save it, they begin thinking how they don't have time to read it right now, and vow to read it someday soon, and forget their vow pretty soon.&lt;/p&gt;

&lt;p&gt;The cycle continues as they find more awesome posts that they might read later.&lt;/p&gt;

&lt;h3&gt;
  
  
  "I love this writer, I will read it later" Hoarder
&lt;/h3&gt;

&lt;p&gt;They bookmark all/any video posted by linustechtips (or &lt;em&gt;insert popular tech name&lt;/em&gt;), any post written by Molly Struve or Emma Wedekind or (&lt;em&gt;insert your favorite/popular writer&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;It shows love and appreciation to the writer. It's alright and encourage them to produce more valuable content.&lt;/p&gt;

&lt;p&gt;But as a hoarder, the reading list grows and most simply forgets to read it. They end up in a mental breakdown once someone says something opposing their favorite writer or if they cannot find the content on their saved list.&lt;/p&gt;

&lt;h3&gt;
  
  
  "This post changed my life" Hoarder
&lt;/h3&gt;

&lt;p&gt;They read the post, start relating their life with the content, they read it with so much passion that it end up having a huge impact on their life.&lt;/p&gt;

&lt;p&gt;After that, no other post seems as important as that one. They might bookmark some other post, but end up reading same post over and over.&lt;/p&gt;

&lt;p&gt;They save a post just for sake of saving, they read a post only to change their life.&lt;/p&gt;

&lt;h3&gt;
  
  
  "I will read this again" Hoarder
&lt;/h3&gt;

&lt;p&gt;Sometimes they are not fanatic as "Impacting Hoarder" mentioned above, however they might read the post again just to refresh their brain once in a while. &lt;/p&gt;

&lt;p&gt;They will use the content in good use, sometimes in research, sometimes in their content.&lt;/p&gt;

&lt;p&gt;However they do not get rid of the bookmark once it's done processing one/few times. They do not love it, but they do not delete it either. &lt;/p&gt;

&lt;h3&gt;
  
  
  "I disagree and I must prove it properly" Hoarder
&lt;/h3&gt;

&lt;p&gt;Usually the above others might save and read the content in a while. These are few others, who spend time to analyse the posts, line by line, and share their reviews with others.&lt;/p&gt;

&lt;p&gt;Some shares short reviews, tweets or videos, but the kind of hoarder on this section are not them.&lt;/p&gt;

&lt;p&gt;They form a very decided opinion of the post, read it few times, compile a list of reasons to justify their feelings. With a clever use of bullet points and respectful words, they present their case with other readers in a very persuasive manner.&lt;/p&gt;

&lt;p&gt;They read the content and always end up finding a fault somewhere. No matter how much you reason with them, they will not budge.&lt;/p&gt;

&lt;p&gt;It's not always negative though, sometimes these kind of hoarder brings very useful information and conversation. You will learn a lot from their opinion and have chance to rethink something from a completely different angle.&lt;/p&gt;

&lt;h1&gt;
  
  
  What kind of hoarder are you? Does it matter?
&lt;/h1&gt;

&lt;p&gt;There are other types of hoarder outside this list, but it does not matter. At least they are hoarding links, and doing something that might bring value at some point. They are just trying to escape reality every now and then, having some peace in mind.&lt;/p&gt;

&lt;p&gt;Once they acknowledge their problem, they will end up bringing more than others who actually does not take any action at all.&lt;/p&gt;

&lt;h1&gt;
  
  
  Bad sides of hoarding
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;You are increasing &lt;strong&gt;junk usage&lt;/strong&gt;. The more you do useless stuff, the more server space is gonna be used, more energy usage, more global warming. Just because you saved something useless.&lt;/li&gt;
&lt;li&gt;It's &lt;strong&gt;hard to find important stuff&lt;/strong&gt;. If you want to find something you saved at beginning, most of time you will have a hard time scrolling down and pick the important one.&lt;/li&gt;
&lt;li&gt;It makes you &lt;strong&gt;lose focus&lt;/strong&gt;. You do not know what to learn anymore. You want to learn web development, mobile development, project management, server management and everything else all at once.&lt;/li&gt;
&lt;li&gt;It gives you &lt;strong&gt;anxiety&lt;/strong&gt;. When will you read that huge list? What about the new things you want to learn? Who is going to filter out things you do not want to learn anymore? &lt;/li&gt;
&lt;li&gt;It causes you &lt;strong&gt;impostor syndrome&lt;/strong&gt;. You feel there is so much left to learn. Everyone knows a lot more than you and sharing a lot of valuable information. Do you even belong here?&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Getting rid of hoarding
&lt;/h1&gt;

&lt;p&gt;This is going to be a long journey just like having an inbox zero. You will need solid proof that you are a hoarder, you will have to convince yourself. (Just like I accepted myself that I hoard links).&lt;/p&gt;

&lt;h3&gt;
  
  
  Get motivation
&lt;/h3&gt;

&lt;p&gt;Overcoming hoarding will take some impressive commitment. So before you start, you first need to get really motivated about doing so. Getting motivated will help you stay consistent in your plans.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make a list of strong reasons why you want to stop hoarding. For example, "I want to be able to understand this writer better", "I want to learn JavaScript as soon as possible". I don't know, your list, your reasoning.&lt;/li&gt;
&lt;li&gt;Review the list whenever you feel your decision is changing. It will remind you of yourself.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Understand the difference between hoarding and collecting
&lt;/h3&gt;

&lt;p&gt;A hoarder saves links/items in excess and has difficulty discarding or reading them later. It's hard to find and they mostly do not know what they are bookmarking and where it goes. Sometimes they will remember that they have this bookmarked somewhere near 1000th bookmark, but not the actual name anywhere. It just goes there and does nothing.&lt;/p&gt;

&lt;p&gt;Collectors have a passion for gathering things as a side interest. Many things can be collected. It is totally up to them what they want to collect. They organize and display the links. They help others with their content, "Top 10 Books I have read last week", "Top 10 public speaking tips" etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start Slow
&lt;/h3&gt;

&lt;p&gt;Do not go and remove all links from every single place. Do not throw out all books at once, do not throw out all junks in dumpster, do not remove all piece of code and start from scratch just randomly.&lt;/p&gt;

&lt;p&gt;Open one or collection each week/month. First week go through one writer/category, second week another, and so on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handle one post at a time
&lt;/h3&gt;

&lt;p&gt;Stop keeping things "For Now", it won't help much. Handle this one thing just only once so you do not end up handling same link over and over.&lt;/p&gt;

&lt;p&gt;If it's a post, read it properly. If it's a video, watch it properly. Decide whether you should watch/read fully at that moment. &lt;/p&gt;

&lt;p&gt;One post at a time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scale down and organize it
&lt;/h3&gt;

&lt;p&gt;One big glob of thousand line of messy code vs thousand small glob of messy code. Yeah, both are terrible. Messy is terrible.&lt;/p&gt;

&lt;p&gt;However, consider one small piece of code at a time, organize it. It might take time, but by end of the day/week, you will end up with some satisfaction.&lt;/p&gt;

&lt;p&gt;Same goes for links, if you try to organize all of the links at once, you will get frustrated. Just handle it smoothly and slowly. Just focus on processing and making it shorter.&lt;/p&gt;

&lt;p&gt;Scale down when needed, but don't force it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make use of the organizing features
&lt;/h3&gt;

&lt;p&gt;On dev.to, you can see the saved posts by category/tags, pocket and other tools also lets you do that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwze7xtvgjjbxko45lvag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwze7xtvgjjbxko45lvag.png" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's best to make the best use of this. If you are learning javascript, go through that, if you are a beginner or trying to help a beginner, go through that, if you are having problem with testing, go to #testing tag. And the list will clean up, you will end up with a positive and healthy mind. &lt;/p&gt;

&lt;h3&gt;
  
  
  Toss uninteresting saves
&lt;/h3&gt;

&lt;p&gt;You wanted to learn devOps (just saying for example) and saved a bunch of links. But now you are not interested in it. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Toss it away. Remove it from your list.&lt;/li&gt;
&lt;li&gt;Send it to people who will actually benefit from the post. It will increase communication, make you much more helpful to community.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Don't procrastinate
&lt;/h3&gt;

&lt;p&gt;If you do not put a deadline, whatever you left on the reading list will be there forever. Set a note on your calendar, whiteboard or sticky. If you do not read the post by that time, remove it unconditionally. &lt;/p&gt;

&lt;h3&gt;
  
  
  Keep it simple
&lt;/h3&gt;

&lt;p&gt;You do not need to learn everything at once. Just because you might want to learn kotlin, rust, c, java, php, python, machine learning in future does not mean you should just collect links for them. It will stay there, do not collect it if you do not need it.&lt;/p&gt;

&lt;p&gt;Do not leave it there, if you clean this up, it will make you a better you. Cleaning out reading list will help you understand the bad points of hoarding and you can apply it in real life, getting rid of book, course and many other hoarding habit.&lt;/p&gt;

&lt;p&gt;Kindly do not save this post for later. Love it and share it with your friends instead to make sure they also benefit from this.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prevent hoarding
&lt;/h1&gt;

&lt;p&gt;Do not jump into reading just random posts. Do not click save button just yet. Try to understand the point and go through the post quickly for a bit.&lt;/p&gt;

&lt;p&gt;Stay focused and organize. Your list will have much more quality. This habit will help you in other areas of your life. &lt;/p&gt;

&lt;p&gt;If you ever feel you have this problem out of control. Seek professional help. This is especially true if it is affecting your life in a significant manner. Extreme hoarding is a sign that you have other underlying issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read&lt;/strong&gt;, &lt;strong&gt;Engage&lt;/strong&gt; and &lt;strong&gt;Share&lt;/strong&gt; instead of &lt;strong&gt;Saving&lt;/strong&gt;. That's one way to contribute and taking action. &lt;/p&gt;

&lt;p&gt;Gathering courses, links and books only to never read it again? That's some serious problem. You should take action now!&lt;/p&gt;

&lt;p&gt;Maybe I am wrong, maybe this was never an issue. Let me know in the comments what you think about it.&lt;/p&gt;

&lt;p&gt;EDIT: It's funny the first reaction this post gets is also a [SAVE] reaction.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7010w8f0etpur1bjxwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7010w8f0etpur1bjxwx.png" width="800" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>motivation</category>
      <category>beginners</category>
      <category>healthydebate</category>
    </item>
    <item>
      <title>VSCode Trick: Reset the Sidebar and Terminal Pane Size</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Tue, 12 Mar 2019 09:21:42 +0000</pubDate>
      <link>https://dev.to/entrptaher/vscode-trick-reset-the-sidebar-and-terminal-pane-size-5cd1</link>
      <guid>https://dev.to/entrptaher/vscode-trick-reset-the-sidebar-and-terminal-pane-size-5cd1</guid>
      <description>&lt;p&gt;Have you ever resized sidebar and terminal like this?&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbxc5jgw1iu6d6n50chaz.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbxc5jgw1iu6d6n50chaz.png" alt="Imgur"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, you either did not care or tried to manually resize it back, right? But did you ever feel you forgot actual size or did not have the satisfaction?&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4b4xn7vgd2zluzncvqsn.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4b4xn7vgd2zluzncvqsn.gif" alt="Imgur"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Just double click the borders of the pane you want to resize.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5eymjx3o2ilaxl6329a3.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5eymjx3o2ilaxl6329a3.gif" alt="Imgur"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Same applies to extension or any other activity, where you want to see the full contents.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8ez4x76m2xn5i4ujpdi.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8ez4x76m2xn5i4ujpdi.gif" alt="Imgur"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it! It is now resized back to appropriate size based on the contents of the sidebar and viewport size. &lt;/p&gt;

&lt;p&gt;Peace!&lt;/p&gt;

</description>
      <category>vscode</category>
    </item>
    <item>
      <title>Automated testing with mocha and puppeteer on circleCI</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Sun, 16 Sep 2018 18:55:02 +0000</pubDate>
      <link>https://dev.to/entrptaher/mocha-and-puppeteer-on-circleci-117e</link>
      <guid>https://dev.to/entrptaher/mocha-and-puppeteer-on-circleci-117e</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvftvebnnqb1ge3k0fyi0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvftvebnnqb1ge3k0fyi0.png" width="626" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Prefetch
&lt;/h1&gt;

&lt;p&gt;I always had trouble understanding why the code quality is important, I would refuse to spend time on this. But recently I found myself in sticky situation over and over because of the quality. If the quality was good, then I would not have to spend million seconds thinking about the problem and structure. Thus I learned mocha, chai, browser automation libraries like puppeteer. But soon I had problems with the CI and code quality checking tools. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I had a very hard time figuring out how to integrate all these newly acquired knowledge into the projects at once.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;It's like trying to build an whole app without writing the first line.&lt;/p&gt;

&lt;p&gt;I would feel empty when I saw nice delicious badges on other repos and some repos had multiple green ones and my repos were almost empty, the code was undocumented and such newbie stuff.&lt;/p&gt;

&lt;p&gt;Then it hit me, I could just create a sample repo from beginning with everything I want step by step and apply my knowledge there at very basic level so I can repeatedly use same process for other projects and relieve my stress over time. That's how this repo was born.&lt;/p&gt;

&lt;p&gt;The result is awesome and I got to add some cool badges too just like others,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ao1jkzbz4rclhvrteh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ao1jkzbz4rclhvrteh5.png" width="282" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ah! the joy when someone tell you the quality is good (be it just for some peace of mind).&lt;/p&gt;

&lt;h1&gt;
  
  
  What this is
&lt;/h1&gt;

&lt;p&gt;A sample repo to show how mocha, puppeteer and a ci can be used to automate various tests. Maybe an automation script was created, but depending on the size of project even that script should be tested to make sure everything works as expected when there is a commit pushed. &lt;/p&gt;

&lt;p&gt;We can build this using BDD, TDD or any other methodology, but whatever method is being used, the steps will always include, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating actual/automation script&lt;/li&gt;
&lt;li&gt;Creating test/mocha script&lt;/li&gt;
&lt;li&gt;Creating/Preparing CI environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Right now most CI and servers always prepares the Xvfb and other required libraries, so we don't have to deal with them too much unless explicitely required.&lt;/p&gt;

&lt;p&gt;NOTE: This readme/post will avoid going into depth and only discuss matters on top, assuming you already know about nodejs, unit testing, mocha/chai, puppeteer and CI. You don't have to know everything, just having the basics will be enough.&lt;/p&gt;

&lt;p&gt;PS: &lt;a href="https://github.com/entrptaher/mocha-ci-test" rel="noopener noreferrer"&gt;THE REPO IS HERE&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why tests?
&lt;/h1&gt;

&lt;p&gt;Yeah, why we are just making simple automation scripts?&lt;br&gt;
Right now we are testing only a sample function. It doesn't seem much. However, imagine 100 scripts or thousand scripts. Is it possible for you to run and test every single script to make sure it works? It won't be possible, and it will become a very stupid headache once that happens. So, even if you don't need these kind of tests, they will help you on long run once you have to do same thing over and over again. &lt;/p&gt;

&lt;p&gt;If you are building a scraper, and have to browse 100 sites or fill 100 forms, it will help when you got to know the script works and can reach the target website/forms when possible. It will also alert you when things goes south.&lt;/p&gt;
&lt;h1&gt;
  
  
  Basic example script
&lt;/h1&gt;

&lt;p&gt;We will create a sample script that will browse example website, extract title and outerHTML and close itself. We will treat the script as an independent one, so we won't be dealing with the closing/opening the browser on the testing environment, rather it will just be there to show how it works.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating the actual script
&lt;/h2&gt;

&lt;p&gt;We will use node 8 with async-await support, and puppeteer for this. &lt;/p&gt;

&lt;p&gt;Basically what we will do is,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launch the browser.&lt;/li&gt;
&lt;li&gt;Navigate to website&lt;/li&gt;
&lt;li&gt;Collect title and outerHTML for testing purpose&lt;/li&gt;
&lt;li&gt;Close browser and cleanup the processes&lt;/li&gt;
&lt;li&gt;Return the data
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/grab-data.js&lt;/span&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="nf"&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;grabData&lt;/span&gt; &lt;span class="o"&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="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="c1"&gt;// will greatly affect the results&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;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// important for running on various server where root user is present&lt;/span&gt;
    &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--no-sandbox&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="s1"&gt;--disable-setuid-sandbox&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="c1"&gt;// actual navigation happens here&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="nf"&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="nf"&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://example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// sample data collection&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;title&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="nf"&gt;title&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;outerHTML&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="nf"&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&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;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;outerHTML&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// cleanup once done&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="nf"&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;outerHTML&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;grabData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Creating test script
&lt;/h2&gt;

&lt;p&gt;When using unit tests, it's important to use timeouts. Make sure to exit the tests, and use proper timeout. Recent mocha will not exit the tests, in that case or in a case where you have infinite timeout, you might end up with a huge cost for the test getting stuck. Mocha by default will run tests one by one. If you want to try asynchronous tests, you can use Ava. Both are fantastic in their own way, popular and has huge support.&lt;/p&gt;

&lt;p&gt;You do not need to test every single thing on automation scripts. Just make sure the scripts works at very basic level for each possible scenerio. If you push 100 commits and the automation script has login and such, it will end up doing 100 logins in very short amount of time, and trigger various alerts, unless it's your website you are testing against.&lt;/p&gt;

&lt;p&gt;We will create the test script with the actual user flow in mind. Check the &lt;code&gt;test/basic.js&lt;/code&gt; for test code. The code is readable even without comments, (and I additionally added too much to the code just to get rid of all eslint errors.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// test/basic.js&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&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;chai&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;grabData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&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;../app/grab-data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tests example website&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testExample&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;browses the website&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testBrowser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;outerHTML&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;grabData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;outerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;outerHTML&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;title has text: example&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testTitle&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;outerHTML has text: example&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testOuterHTML&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;outerHTML&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example&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;The result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fns4t4148biwxvp1bamrg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fns4t4148biwxvp1bamrg.png" alt="Mocha test" width="421" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code quality
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Linting
&lt;/h3&gt;

&lt;p&gt;Sometimes you want to make sure the quality of the work is well and you are not pushing garbage inconsistent code to your repo. If you have multiple contributors to the repo you can even make sure their code passes all linting tests (excluding all eslint-disable hacks), and it returns safely. &lt;/p&gt;

&lt;p&gt;Thus we are simply gonna use, &lt;code&gt;eslint --init&lt;/code&gt;, and follow the wizard to install airbnb rules, then run using &lt;code&gt;eslint .&lt;/code&gt;,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjehik2pvi73jpmbt13uu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjehik2pvi73jpmbt13uu.png" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;opps! and then &lt;code&gt;eslint --fix . --ext .js&lt;/code&gt; for auto fixing basic problems. &lt;/p&gt;

&lt;p&gt;Also we can include these in the scripts inside &lt;code&gt;package.json&lt;/code&gt; and simply call it later on. &lt;/p&gt;

&lt;p&gt;Since we have mocha and node as target, we have to manually edit things a bit and add &lt;code&gt;node&lt;/code&gt; and &lt;code&gt;mocha&lt;/code&gt; as the target environment. Otherwise it will throw errors like, &lt;code&gt;'describe' is not defined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And since we are using browser code inside puppeteer, it will throw errors like how &lt;code&gt;document is not defined&lt;/code&gt; and such. We need to include &lt;code&gt;browser&lt;/code&gt; as targets too, or apply workarounds.&lt;/p&gt;

&lt;p&gt;We are all good once we put and lint it. It might throw on some small warnings about best practices, we can fix them if we want, or move on.&lt;/p&gt;

&lt;p&gt;The result:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdgh1w9tucvjlv1mt2ouu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdgh1w9tucvjlv1mt2ouu.png" width="478" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other quality checks
&lt;/h3&gt;

&lt;p&gt;If not enough, we can use other code quality checking tools such as &lt;code&gt;codacy&lt;/code&gt;. All we have to do is add the project and it will do everything else itself. It will clone project, detect programming languages, run various code patterns and calculate project metrics. Finally it will give us a project certification with a grade A to F, A being best, F being worst. The sample repo might get A at beginning, or an F. But if we are not careful enough, it will scream at us later on just like the other tools we are using.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating/Preparing CI environment
&lt;/h2&gt;

&lt;p&gt;Headless is a big factor on browsing and testing. Sometimes headless will leave a big footprint and get caught as bot, otherwise it's perfect for testing own websites where we can explicitly exclude it for testing. &lt;/p&gt;

&lt;p&gt;Enabling headless will take 6+ seconds to launch on CI environment sometimes, while disabling headless will reduce the time to 1 second. It can be optimized and hacked thru. While this doesn't seem like a big deal, it is indeed a big deal if you have a tight budget and CI costs are really high. Most CI gives you free time to run, but it will quickly add up where you have almost limited resource.&lt;/p&gt;

&lt;p&gt;Make sure to enable headless unless explicitly required.&lt;/p&gt;

&lt;p&gt;CircleCI has &lt;code&gt;node:8.12.0-browsers&lt;/code&gt; and other similar tags that includes the required libraries for &lt;code&gt;headless&lt;/code&gt; and &lt;code&gt;xvfb&lt;/code&gt; display. Just using their wizard is enough to get you going. &lt;/p&gt;

&lt;p&gt;We will need to include the linting, and then we will run the actual test, make sure it's good quality code and works well, without running it ourselves on our own machine. We can even apply the fixing if we are brave enough.&lt;/p&gt;

&lt;p&gt;Check out &lt;code&gt;.circleci/config.yml&lt;/code&gt; for the code. The result looks beautiful, except it won't if all tests were ended in red.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3u92sko2io0q0qr5ne32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3u92sko2io0q0qr5ne32.png" alt="CircleCI example" width="665" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final steps
&lt;/h2&gt;

&lt;p&gt;So far we almost copy pasted everything or followed wizard and everything was done. We just need to setup the actual project on circleCI and link the repo. Then push the repo will trigger the build. &lt;/p&gt;

&lt;p&gt;That wasn't hard, was it?&lt;/p&gt;

&lt;h1&gt;
  
  
  It triggers on every commit
&lt;/h1&gt;

&lt;p&gt;It will be very bad to trigger hundreds or thousands of tests on every commit/push. Sometimes you will just update the readme files and won't want to trigger things. And sometimes you will want to trigger only after making a major change. To prevent such worse things from happening, make sure to push to a separate branch and do pull request only if you are satisfied with current code changes. Merging to master branch will trigger the build, which also can be setup as various webhooks and breaking measurements.&lt;/p&gt;

&lt;p&gt;So far this repo did not need such a big readme, but I ended up writing it because I was very lazy at writing documentations and ended up confused whenever I needed some script from some old repo to use. &lt;/p&gt;

&lt;p&gt;Later I will be able to extend this repo with awesome things like,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;process management, &lt;/li&gt;
&lt;li&gt;queue management, &lt;/li&gt;
&lt;li&gt;docker builds, &lt;/li&gt;
&lt;li&gt;code coverage&lt;/li&gt;
&lt;li&gt;server deployments. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So much potential!&lt;/p&gt;

</description>
      <category>mocha</category>
      <category>testing</category>
      <category>ci</category>
      <category>puppeteer</category>
    </item>
    <item>
      <title>Why are you programming?</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Mon, 30 Jul 2018 15:33:36 +0000</pubDate>
      <link>https://dev.to/entrptaher/why-are-you-programming-4io1</link>
      <guid>https://dev.to/entrptaher/why-are-you-programming-4io1</guid>
      <description>&lt;p&gt;People started to learn web development thinking about future, right now web development is no longer a thing for future, it's present. However, this arises another concern, what's now? AI? Machine Learning? Self driving? Mars? Aliens? Prevent global warming? More programming?&lt;/p&gt;

&lt;p&gt;Predictions can go wrong any time, and they are dangerous. However you, those who don't live in the past or present, have some ideas/plans that you are following, right?&lt;/p&gt;

&lt;p&gt;So,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is it? What do you think will be here 5-10-50 years later? &lt;/li&gt;
&lt;li&gt;Are you planning for that? What's your plan? &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why are you programming/developing/hacking...or doing whatever you are doing?&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
    </item>
    <item>
      <title>Hacking a bit of dev.to with CSS</title>
      <dc:creator>Md Abu Taher</dc:creator>
      <pubDate>Thu, 07 Jun 2018 00:39:13 +0000</pubDate>
      <link>https://dev.to/entrptaher/hacking-a-bit-of-devto-with-css-43ib</link>
      <guid>https://dev.to/entrptaher/hacking-a-bit-of-devto-with-css-43ib</guid>
      <description>&lt;h1&gt;
  
  
  The problem: No sticky save for lazy developers
&lt;/h1&gt;

&lt;p&gt;When you are browsing this website, you get the titles like this, sometimes there are description, images and tags. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd8ua39z6o76alb6b8lqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd8ua39z6o76alb6b8lqs.png" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you have two options here, either open to read it, or save it for later. Sometimes the titles are tricky as this post you are reading right now. Maybe you thought it was something very interesting, but it was actually a trap to get views/likes etc. Let's open the post to see what's inside.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzeik65xmd8tpvxx7sc49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzeik65xmd8tpvxx7sc49.png" width="800" height="645"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! It's a great article to read with lots of valuable information. But wait, you got to hurry up with your train so you have decided to save the post. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8z5qdei0570tbainw2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8z5qdei0570tbainw2e.png" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The save button is either on the previous page or at the bottom of current post, no save button on the side of the post where you could easily just save it for later. Maybe you can use bookmarks with ctrl + d, but that'd be so boring.&lt;/p&gt;

&lt;p&gt;We can either wait for the team to build one for us or we can build one ourselves. Won't it be great to fiddle with some little stuff sometimes?&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution: Fiddling with CSS
&lt;/h1&gt;

&lt;p&gt;Okay, let's extract the selector first. I'll right click, select "Inspect Element" and it will be highlighted like this.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplx6k7twxypdy4bpiln7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplx6k7twxypdy4bpiln7.png" width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we know what to break. Let's make some css code for the selector,&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="nf"&gt;#article-reaction-actions&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;fixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* This will make it floating around */&lt;/span&gt;
    &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Just to make sure it's on top of everything */&lt;/span&gt;
    &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* So it stays sticky to bottom of my screen */&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Well it's transparent otherwise */&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;880px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* The size of the parent container */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I am not going to discuss what each letter of the above snippet does. I'm too lazy to do that right now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feckil376n8jsqy9kbiyw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feckil376n8jsqy9kbiyw.png" width="610" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To apply the style, I'll use &lt;a href="https://chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe" rel="noopener noreferrer"&gt;Stylish&lt;/a&gt;, which is a chrome extension. There are &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/stylish/" rel="noopener noreferrer"&gt;firefox&lt;/a&gt; and &lt;a href="https://safari-extensions.apple.com/details/?id=com.sobolev.stylish-5555L95H45" rel="noopener noreferrer"&gt;safari&lt;/a&gt; version too.&lt;/p&gt;

&lt;p&gt;Let's create a new style. when I am reading this post, I will install the chrome extension, come back to this post, and then click the icon.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnc3n4ha2olk9ehrb0um.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqnc3n4ha2olk9ehrb0um.png" width="271" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I'll use the above snippets code, enter a nice name and save it.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9v9suzgd0iwgckm8rpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9v9suzgd0iwgckm8rpa.png" width="800" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great, now when I refresh the page, I'll see this,&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5157a8tuo7afcj7yybj.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5157a8tuo7afcj7yybj.gif" width="1024" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nice, isn't it? I can use this to read first few lines and decide to save or heart it without scrolling to end.&lt;/p&gt;

&lt;p&gt;PS: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This was just to relieve my boredom, but I use Stylish for many different websites. I also use Tampermonkey to fiddle with the JS if needed. &lt;/li&gt;
&lt;li&gt;Please don't make a change on website or create a chrome extension just for this post. This is no big deal.&lt;/li&gt;
&lt;li&gt;Sorry for using posts on images without permission :D, it's dev.to, so I guess it won't hurt. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
