Python Selenium created a function that parses web data (Google headless mode).
When I checked the print, it was self.Add driver.get_screenshot_as_file('1.png') to take a screenshot and parse it.
It works fine.
It's the same code, but if you don't add screenshots, you can't parse it. Does anyone know why?
python selenium
The time the snapshot function (get_screenshot_as_file) completes It's probably because the page you're trying to crawl takes longer than the time it takes to load all the pages.
It's similar to the effect of sleeping().
The target page is probably a page that receives data asynchronously after loading, and additional HTML elements are created and distributed with the received data. If you approach this asynchronous operation before it's complete, you can't parse it.
© 2024 OneMinuteCode. All rights reserved.