Zaidkhalid44 / IRCTC

Technologies used: JavaScript, Puppeteer, Tesseract.js, Jimp Description: Developed an automated system using Puppeteer and Tesseract.js to streamline IRCTC train ticket booking, handling login, captcha solving, and form filling. Automated login and form-filling tasks, reducing manual effort by approximately 90%.
Other
0 stars 0 forks source link

How to run repo #1

Open 520rahul opened 2 months ago

520rahul commented 2 months ago

@Zaidkhalid44 Dear please guide how to install and run rwpo on windows and how to book ticket for more then 1 person

Zaidkhalid44 commented 2 months ago

@520rahul Currently, the project supports booking for only one passenger, but we can add support for multiple passengers in the future. If you'd like to contribute, feel free to do so!

To run this repository, you need to install the dependencies, Tesseract, the npm module Puppeteer, and Jimp.

520rahul commented 2 months ago

@Zaidkhalid44 can u please explain me step by step process as i m techically not advanced

Zaidkhalid44 commented 2 months ago

Install Node.js: Download and install the LTS version from the Node.js official website.

Install Puppeteer and Jimp:

npm install puppeteer jimp

Install Tesseract OCR:

Follow the installation instructions on the Tesseract GitHub Wiki for your operating system (Windows, macOS, Linux). Verify the installation by running: tesseract -v

520rahul commented 2 months ago

Install Node.js: Download and install the LTS version from the Node.js official website.

Install Puppeteer and Jimp:

npm install puppeteer jimp

Install Tesseract OCR:

Follow the installation instructions on the Tesseract GitHub Wiki for your operating system (Windows, macOS, Linux). Verify the installation by running: tesseract -v

@Zaidkhalid44 i have followed all your instructions, now please guide how to run the repo

Zaidkhalid44 commented 2 months ago

@520rahul

Prerequisites

  1. Install Node.js: Ensure Node.js (v14.x or higher) and npm (v6.x or higher) are installed on your system. You can download Node.js from nodejs.org.
  2. Install Tesseract: Download and install Tesseract OCR software from here.
  3. Ensure Puppeteer and Jimp are available: These will be installed as part of the project's dependencies.

Installation

  1. Clone the repository:
    git clone https://github.com/Zaidkhalid44/IRCTC.git
  2. Navigate to the project directory:
    cd IRCTC
  3. Install the dependencies:
    npm install

Running the Script

  1. Run the main automation script:
    node main.js

    This will start the automated ticket booking process.

Make sure to configure any necessary settings in config.json before running the script.

520rahul commented 2 months ago

@520rahul

Prerequisites

  1. Install Node.js: Ensure Node.js (v14.x or higher) and npm (v6.x or higher) are installed on your system. You can download Node.js from nodejs.org.
  2. Install Tesseract: Download and install Tesseract OCR software from here.
  3. Ensure Puppeteer and Jimp are available: These will be installed as part of the project's dependencies.

Installation

  1. Clone the repository:
    git clone https://github.com/Zaidkhalid44/IRCTC.git
  2. Navigate to the project directory:
    cd IRCTC
  3. Install the dependencies:
    npm install

Running the Script

  1. Run the main automation script:

    node main.js

    This will start the automated ticket booking process.

Make sure to configure any necessary settings in config.json before running the script.

@Zaidkhalid44 below error is coming while login in:- Attempt 1 to solve captcha Waiting for captcha image... Captcha image found, downloading... Captcha image downloaded. Image processed. Error executing Tesseract: Error: Command failed: tesseract ./captcha.png stdout -l eng --psm 7 'tesseract' is not recognized as an internal or external command, operable program or batch file.

node:internal/errors:984 const err = new Error(message); ^

Error: Command failed: tesseract ./captcha.png stdout -l eng --psm 7 'tesseract' is not recognized as an internal or external command, operable program or batch file.

at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5) {

code: 1, killed: false, signal: null, cmd: 'tesseract ./captcha.png stdout -l eng --psm 7'

520rahul commented 2 months ago

@Zaidkhalid44 one more request to update repo to book more then 1 passenger

Zaidkhalid44 commented 2 months ago

@520rahul The error you're encountering indicates that the Tesseract OCR executable (tesseract) is not installed or not recognized by your system's PATH. To solve this issue, you need to install Tesseract OCR and ensure that it is accessible from the command line.

watch out this: https://www.youtube.com/watch?v=2kWvk4C1pMo&t=52s

And I appreciate your feedback and will add the feature to book tickets for multiple passengers soon. Stay tuned for the update, and thank you for using the tool!