CompTIA PenTest+ (PT0-002) — Question 338

Which of the following would be the most efficient way to write a Python script that interacts with a web application?

Answer options

Correct answer: C

Explanation

The correct answer is C because the requests library provides a simple and efficient interface to make HTTP requests in Python, which is essential for interacting with web applications. Options A and B suggest creating custom solutions that are unnecessary, and D involves using a command-line tool rather than a Python script, which would not be as efficient for this purpose.