Benjamin-Loison / selenium-wire

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

Push mechanism instead of polls #3

Open Benjamin-Loison opened 1 month ago

Benjamin-Loison commented 1 month ago
while True:
    for request in driver.requests:
        if request.url == URL:
            response = request.response
            if response is not None:
                response = decode(response.body, response.headers.get('Content-Encoding', 'identity')).decode('utf-8')
                print(response)
                driver.quit()
                exit(0)
    time.sleep(1)

Would help for instance OC3K /home/benjamin/notifications/notifyOnFedExUpdate.py.