wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.86k stars 241 forks source link

I'm trying to capture a JSON request and in the body I can see the particular calendar header that I need but it appears to be an empty list, while inspecting through devtools I can see the complete response with the calendar not empty #684

Open aashish-013 opened 1 year ago

aashish-013 commented 1 year ago

def request(self): request = self.driver.wait_for_request('/delivery/calendar',timeout=30) body = decode(request.response.body, request.response.headers.get('Content-Encoding', 'identity')) return body

Here is the response i'm getting: {'Address': None, 'ExpertCalendar': None, 'ThirdPartyCalendars': [], 'DeliveryLabels': {'DeliveryMessageTitle': 'Your order is coming in zero deliveries', 'DeliveryMessageBody': 'Because your items are coming from different warehouses they may arrive at different times.', 'UnableToDisplayDatesFor3rdParty': 'As we use a delivery partner to your postcode we are unable to display an exact date to your property. Please continue with your order and a member of our team will ring you within 48 hours to arrange delivery to our delivery partner who will then be in contact to schedule a date to suit you. Due to this the order will entail a delivery charge.'}, 'DeliveryInformation': {'DeliveriesCount': 0}}

Here is how it looks in devtools:

{ "Address": null, "ExpertCalendar": { "ExpertCalendarVersion": "ExpertCalendarV3", "ExpertCalendarPageSize": 7, "RenderExpandedInitially": false, "HasPremiumService": false, "IsClickAndCollect": false, "IsThirdPartyDelivery": false, "RenderRedBox": false, "RenderOrangeBox": false, "HideChooseTimeslotButton": false, "Options": [ {

I'm not sure why the expert calendar is None, I apologize for the formatting