Find Jobs
Hire Freelancers

Catch errors properly in Node.js script for Puppeteer

$10-50 USD

완료함
게시됨 거의 6년 전

$10-50 USD

제출할때 지불됩니다
Hi, I'm using Puppeteer to generate PDF documents (see [login to view URL]). This works well when there are no errors, but when there's a page error or when the URL is wrong (for example), then the script just hangs. From what I understand this is because the promises after the promises that "crashes" are still trying to resolve, but I'm not a Node.js expert so I'm not sure. I'm calling the node.js script form PHP, but the same thing happens when I call in the command line. The script is similar (but more elaborate) to the default script that's on the Puppeteer website: const puppeteer = require('puppeteer'); (async () => { const browser = await [login to view URL](); const page = await [login to view URL](); await [login to view URL]('[login to view URL]', {waitUntil: 'networkidle2'}); await [login to view URL]({path: '[login to view URL]', format: 'A4'}); await [login to view URL](); })(); If the goto event fails for example then the script doesn't terminate. What I need is someone to: 1) rewrite the script so it catches errors properly in a way that I can use them OUTSIDE the script as well (so when the PHP call is finished); I can read the output that the script generates so I'm guessing a combination of [login to view URL] and exit codes would work. You need to catch errors with the [login to view URL], but also [login to view URL] (error). More info on how other people seem to do this is on [login to view URL] and [login to view URL] and various other places on the web. 2) supply a way to call multiple instances of Puppeteer in a pool or other way so that I can just start a new page instead of a new browser every time I need a conversion. These instances don't need to live long, but I need to have at least one open all the time so the conversion can happen quickly. This is needed because I do many thousands of conversions a day and the time to wait for the browser to open is too long. I need this done quickly so only reply if you're available to do this quickly and have the right experience with node.js Thanks!
프로젝트 ID: 17286954

프로젝트 정보

6 제안서
원격근무 프로젝트
활동 중 6년 전

돈을 좀 벌 생각이십니까?

프리랜서 입찰의 이점

예산 및 기간 설정
작업 결과에 대한 급여 수급
제안의 개요를 자세히 쓰세요
무료로 프로젝트에 신청하고 입찰할 수 있습니다
프로젝트를 수여된 사용자:
사용자 아바타
Hi, I've done a few scripts in the past using Puppeteer. I will solve the problem related to error catching, and finally, provide a way to leave the browser instance opened so it will be responsive for the next conversion.
$45 USD 1일에
5.0 (1 건의 리뷰)
1.1
1.1
6 이 프로젝트에 프리랜서들의 평균 입찰은 $60 USD입니다.
사용자 아바타
Hi, how are you? I am a senior web developer with 5 years of experience in building websites. I am very experienced in web development with PHP(CodeIgniter, Laravel, WordPress, ...), Java(JSP, Spring, Hibernate, Struts, JSF...), JavaScript(MEAN, ReactJS, ...) and so on. Here are my generic working style. - Communication is first, My timezone is as flexible as you want. - Best user experience and keep pixel perfect design. - Always not satisfied with my results and try hard to improve. - Quality of Code is guaranteed. (Robust and bug-free, adopt design patterns) - Bug & issue track using Github, Bitbucket and so on. I am sure I can deliver high quality product and I want to have an interview with you. Please consider working with me. I will do my best. Thanks.
$55 USD 10일에
5.0 (1 건의 리뷰)
2.6
2.6
사용자 아바타
Hi dear friend, I am expert in Node.js and can fix your script catche issue and all other errors which you have mentioned to fix.
$100 USD 1일에
4.8 (1 건의 리뷰)
2.2
2.2
사용자 아바타
to handle errors in async/await you have to use try catch block. I am a back-end developer so i usually do this all the time in my code
$50 USD 1일에
0.0 (0 건의 리뷰)
0.0
0.0

고객에 대한 정보

국기 (NETHERLANDS)
eindhoven, Netherlands
4.9
36
결제 수단 확인
11월 9, 2010부터 회원입니다

고객 확인

감사합니다! 무료 크레딧을 신청할 수 있는 링크를 이메일로 보내드렸습니다.
이메일을 보내는 동안 문제가 발생했습니다. 다시 시도해 주세요.
등록 사용자 전체 등록 건수(일자리)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
미리 보기 화면을 준비 중...
위치 정보 관련 접근권이 허용되었습니다.
고객님의 로그인 세션이 만료되어, 자동으로 로그아웃 처리가 되었습니다. 다시 로그인하여 주십시오.