When using web.whatsapp.de, it can be seen that the link to the resulting image may look like this:
blob:https:
If the link is copied to the address window, it will open the image, however, if the "blob" is ignored, it will simply open a new window on the whatsapp website.
I am trying to download the image displayed on this link.
But using common methods, such as using a request, or urllib.request, or even BeautifulSoup, will always work at one point: "blob" at the beginning of the URL will throw an error.
These answers Downloading a file from a Blob URL using Python will result in an Error error
URLError: <urlopen error unknown url type: blob>
or error
InvalidSchema: No connection adapters were found for 'blob:https://web.whatsapp.com/f50eac63-6a7f-48a4-a2b8-8558a9ffe015'
(using BeatufilSoup)
Using your own approach, for example:
import requests
url = 'https://web.whatsapp.com/f50eac63-6a7f-48a4-a2b8-8558a9ffe015'
fileName = 'test.png'
req = requests.get(url)
file = open(fileName, 'wb')
for chunk in req.iter_content(100000):
file.write(chunk)
file.close()
, BeautifulSoup.
Chrome, Selenium Python, , .