You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vấn đề:
Hiện tại dữ liệu lấy từ mỗi trang phải xuất ra ngay, trong khi nhu cầu là đặt 1 mảng rỗng bên ngoài vòng for. Mỗi vòng lặp, khi lấy được dữ liệu của 1 trang rồi, thì tống vào cái mảng rỗng ở trên. Nếu được thế thì kết quả cuối chứa toàn bộ kết quả của 20 trang, thay vì lắt nhắt từng trang 1. Bất chấp việc khai báo mảng rỗng bên ngoài kia dùng var hay let, thì cuối cùng đều bị báo lỗi "undefined".
The text was updated successfully, but these errors were encountered:
Do cách truyền variable vào hàm page.evaluate() của Puppeteer. Xem thêm ở bài [Puppeteer: pass variable in .evaluate(https://stackoverflow.com/questions/46088351/puppeteer-pass-variable-in-evaluate)]
ngminhtrung
changed the title
Không đặt được biến global để lưu trữ kết quả của toàn bộ 20 trang
[Fixed] Không đặt được biến global để lưu trữ kết quả của toàn bộ 20 trang
Mar 12, 2018
Vấn đề:
Hiện tại dữ liệu lấy từ mỗi trang phải xuất ra ngay, trong khi nhu cầu là đặt 1 mảng rỗng bên ngoài vòng for. Mỗi vòng lặp, khi lấy được dữ liệu của 1 trang rồi, thì tống vào cái mảng rỗng ở trên. Nếu được thế thì kết quả cuối chứa toàn bộ kết quả của 20 trang, thay vì lắt nhắt từng trang 1. Bất chấp việc khai báo mảng rỗng bên ngoài kia dùng var hay let, thì cuối cùng đều bị báo lỗi "undefined".
The text was updated successfully, but these errors were encountered: