feat: 飞猪脚本调试
This commit is contained in:
@@ -102,6 +102,33 @@ const checkLoginStatus = async (page) => {
|
||||
await page.waitForTimeout(4000 + Math.random() * 1000);
|
||||
await page.getByText('房价房量日历').click();
|
||||
|
||||
// 获取网页接口(监听所有请求)
|
||||
await page.on('request', response => {
|
||||
const url = response.url()
|
||||
|
||||
// log.info('request response:', url)
|
||||
|
||||
if (url.includes('/heinventory/queryRoomTypeAndRatePlanLite')) {
|
||||
// const data = await response.json()
|
||||
|
||||
log.info('interface response:', JSON.parse(response.postData()))
|
||||
}
|
||||
// log.info('URL:', request.url())
|
||||
// log.info('Method:', request.method())
|
||||
// log.info('PostData:', request.postData())
|
||||
})
|
||||
|
||||
// 获取接口返回数据
|
||||
await page.on('response', async (response) => {
|
||||
const url = response.url()
|
||||
|
||||
if (url.includes('/heinventory/queryRoomTypeAndRatePlanLite')) {
|
||||
const data = await response.json()
|
||||
|
||||
log.info('interface response:', data)
|
||||
}
|
||||
})
|
||||
|
||||
// await page.pause();
|
||||
/*
|
||||
* 1、我要知道日期
|
||||
|
||||
Reference in New Issue
Block a user