Skip to content

How to read a csv file from input element with vanilla js?

I’ve been trying to read a csv file provided by the user with html form and then process the data. I wanted to approach this with Fetch. It works great when reading a file located on a server. Problem starts when I want to let the user pick a local file. Of course it doesn’t work as it takes corre…

Puppeteer & cycling a process through multiple users

I’m trying to scrape information from a webpage behind a login wall for two users. As it stands, I’ve managed to get the code to do what I want for the first user i.e. go to webpage, login, gather the links associated with properties in a saved list, use that list to gather more details and log th…

Puppeteer: compare return result with a text file

So I have this code, which is now scraping the web and returns the result (message and username): Since the above code is scraping a website that is dynamically changing, what I’m trying to achieve is to avoid returning duplicate messages. One of the ways I thought it could be possible done is by: creat…

What is the best way to promisify library in js?

In one of my previous posts I realised I needed to promisify (turn a callback into a new promise) a npm module to make clean error handling. Problem is, the more I started to think about the organisation of promisifing a library the more it dawned on me that it could easily become a big fat mess. How should I

Javascript Regex multiple search in two words

I want to transfer the results between Regex and two words to an array, but unfortunately I couldn’t this. Can you help me? In this text I will search this content, Based on this I write a regex like this However, this way, it takes the whole, not piece by piece. Thank you in advance for your help. Answ…

Keyup works while keypress doesn’t Vanilla JS

I’m kinda re-learning JS and try to make modal windows in vanilla JS. So, my task is to make Escape button work and close modal on hitting it. I found out that when I put ‘keypress’ event on document, it fails to work, while ‘keyup’ works okay. I couldn’t find exact info on…

Insert Only One Record In MYSQL database using php

i am working on a project where i want to insert only one record in a specific time. For Example: in the project client rate a contractor only once.(when the construction is in working) once he rated he cannot rate second time whatsoever. I checked online but didn’t find what i am looking for. Now I hav…