I want to check the specification of the HTTP protocol using Selenium Wire to see how can I request resources in pieces and which HTTP response indicates that the resources can be loaded in pieces.
Below is the code:
from seleniumwire import webdriver
## Get the URL
driver = webdriver.Chrome()
driver.get("https://google.com")
## Print request headers
for request in driver.requests:
print('-------------------------------------------------')
print(request.url) # <--------------- Request url
print('-------------------------------------------------')
print(request.method) # <----------- Request method
print('-------------------------------------------------')
print(request.headers) # <----------- Request headers
print('-------------------------------------------------')
print(request.response.headers) # <-- Response headers
print('-------------------------------------------------')
print(request.response)
print('-------------------------------------------------')