Search code examples
pythonpython-requestspython-requests-html

Python requests save randomly generated image


I am attempting to use python requests in order to save an image from a webpage. However, the image is randomly generated via php, as shown by the code below, and is different each time. The image is used for a captcha, and changes between each request.

<img src="image.php">

How would I go about properly saving this image?


Solution

  • I think you need to use selenium. If you are trying to write something that can bypass captcha.

    How to save an image locally using Python whose URL address I already know?

    How to download an image using Selenium (any version)?