I am trying to download all the episodes of detective Conan from https://www.kiss-anime.ws/ (kudos to them). While scraping the download URL from the website, I am facing an issue.
Let's say I want to download the first episode of detective Conan, so I use this URL (https://www.kiss-anime.ws/Anime-detective-conan-1) to scrape the download URL. Now when I try to get the HTML code of the website, to extract the download URL, using the following code:
from urllib.request import Request, urlopen
req = Request('https://www.kiss-anime.ws/Anime-detective-conan-1', headers={'User-Agent': 'Mozilla/5.0'})
webpage = urlopen(req).read()
I get the following error
Traceback (most recent call last): File "refine.py", line 41, in webpage = urlopen(req).read() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 531, in open response = meth(req, response) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 640, in http_response response = self.parent.error( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 569, in error return self._call_chain(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 503: Service Temporarily Unavailable
I don't want to go to every link and click on the download link manually as there are over 900 episodes. Once I have the link I will download the episode using the following code: (in case anyone is wondering how I would do that)
import webbrowser
webbrowser.open("https://www.kiss-anime.ws/download.php?id=VkE3eFcvTlpZb0RvKzJ0Tmx2V2ROa3J4UWJ1U09Ic0VValh1WGNtY2Fvbz0=&key=B2X2kHBdIGdzAxn4kHmhXDq0XNq5XNu1WtujWq==&ts=1584489495")
Any help would be much appreciated, thank you!
requests
, too? – DaweoSelenium
, as by using it you looks like human user for webpage – Daweo