Puppeteer-to-Playwright - เครื่องมือแปลงสคริปต์
(github.com/checkly)แปลงสคริปต์ Puppeteer เดิมให้เป็น Playwright
-
แปลง import
-
แปลงเมธอดพื้นฐานเป็น API ใหม่ ( setViewport → setViewportSize )
-
สร้าง browser context แบบชัดเจน
-
ลบ explicit waiting
-
แปลงคำสั่งที่เกี่ยวข้องกับคุกกี้
ฟีเจอร์ที่ยังไม่รองรับในตอนนี้
-
อัปโหลด/ดาวน์โหลดไฟล์
-
Request/Response Interception
-
หลาย context / tab
1 ความคิดเห็น
หลายคนที่ย้ายจาก Puppeteer ไปใช้ Playwright ดูจะพอใจกันทีเดียว
ถ้ามีสคริปต์ที่เขียนไว้เดิมจำนวนมาก เครื่องมือนี้ก็น่าจะช่วยได้ครับ
microsoft/playwright รีลีส - ควบคุมเบราว์เซอร์ระยะไกล https://th.news.hada.io/topic?id=1374
เปิดตัว Playwright 1.4.0 https://th.news.hada.io/topic?id=2828
Headless Dev - คลังความรู้ Puppeteer & Playwright https://th.news.hada.io/topic?id=2685