Skip to content

Check HTML element exists or not in multiple URLs using puppeteer.

License

Notifications You must be signed in to change notification settings

aotr/Check-HTML-element-exists-or-not

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check HTML element exists or not

Check HTML element exists or not in multiple URLs using puppeteer.

Getting Started

Installation

I use Puppeteer,https and puppeteer-cluster in project, run:

npm i puppeteer
# or "yarn add puppeteer"
npm i puppeteer-cluster
# or "yarn add puppeteer-cluster"

Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, or to download a different browser, see Environment variables.

Usage

Please replace the requests variable as per your requirement. It is a Array of String its mainly content URLs.

const requests = [
  'https://www.worldpranichealing.com/en/wesak/benefits-of-meditating-during-wesak/',
  'https://www.worldpranichealing.com/en/wesak/a-ceremony-in-the-himalaya/',
];

Example

To run the repo: clone the repo, npm install on the package, and run the app:

git clone https://github.com/aotr/Check-HTML-element-exists-or-not.git
cd Check-HTML-element-exists-or-not
npm install
node app.js