In Chapter 5, Web Scraping Navigation, we looked at navigating websites that require JavaScript using selenium and the WebDriver protocol. There is another protocol that has been developed recently that offers many more features you can take advantage of to drive a web browser. The Chrome DevTools Protocol was started for use on Chrome browsers, but it has been adopted by the W3C's Web Platform Incubator Community Group as a project. The major web browsers work together to develop a standard protocol called the DevTools Protocol to adopt for all of their browsers.
The DevTools Protocol allows external programs to connect to a web browser and send commands to run JavaScript, and collect information from the browser. Most importantly, the protocol allows the program to collect the HTML on demand. This way, if you were scraping...