I am scraping this website (with Selenium) that is basically a database with exam questions. I need to take a screenshot of each question (and answers). Is there a way to screenshot ONLY the question and answers and not the whole page?
So far I've tried using screenshot_as_png
but no success.
Some questions are very long and don't fit on the screen. This is why I don't even know if what I'm trying to achieve is possible. An alternative is also accepted. Perhaps a way I could extract the whole question (including the images) would solve the problem for me.
Example: I'm able to locate a div with a given question. How can I screenshot only the content of the question?