mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-04-26 08:54:59 +02:00
Detect 'fake' 404 page (with HTTP 200) for adapter_royalroadcom
This commit is contained in:
parent
95f2dfc170
commit
5be7b3e788
1 changed files with 5 additions and 0 deletions
|
|
@ -162,6 +162,11 @@ class RoyalRoadAdapter(BaseSiteAdapter):
|
|||
soup = self.make_soup(data)
|
||||
# print data
|
||||
|
||||
# site has taken to presenting a *page* that says 404 while
|
||||
# still returning an HTTP 200 code.
|
||||
div404 = soup.find('div',{'class':'number'})
|
||||
if div404 and stripHTML(div404) == '404':
|
||||
raise exceptions.StoryDoesNotExist(self.url)
|
||||
|
||||
## Title
|
||||
title = soup.select_one('.fic-header h1[property=name]').text
|
||||
|
|
|
|||
Loading…
Reference in a new issue