mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Update Microwaves and RF
This commit is contained in:
parent
c25e4c9fd6
commit
7873048dbf
@ -15,7 +15,7 @@ import re
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from calibre.utils.magick import Image
|
from calibre.utils.magick import Image
|
||||||
|
|
||||||
class Microwave_and_RF(BasicNewsRecipe):
|
class Microwaves_and_RF(BasicNewsRecipe):
|
||||||
|
|
||||||
Convert_Grayscale = False # Convert images to gray scale or not
|
Convert_Grayscale = False # Convert images to gray scale or not
|
||||||
|
|
||||||
@ -25,9 +25,9 @@ class Microwave_and_RF(BasicNewsRecipe):
|
|||||||
# Add sections that want to be included from the magazine
|
# Add sections that want to be included from the magazine
|
||||||
include_sections = []
|
include_sections = []
|
||||||
|
|
||||||
title = u'Microwave and RF'
|
title = u'Microwaves and RF'
|
||||||
__author__ = 'kiavash'
|
__author__ = u'kiavash'
|
||||||
description = u'Microwave and RF Montly Magazine'
|
description = u'Microwaves and RF Montly Magazine'
|
||||||
publisher = 'Penton Media, Inc.'
|
publisher = 'Penton Media, Inc.'
|
||||||
publication_type = 'magazine'
|
publication_type = 'magazine'
|
||||||
site = 'http://mwrf.com'
|
site = 'http://mwrf.com'
|
||||||
@ -96,9 +96,16 @@ class Microwave_and_RF(BasicNewsRecipe):
|
|||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
|
|
||||||
# Fetches the main page of Microwave and RF
|
# Fetches the main page of Microwaves and RF
|
||||||
soup = self.index_to_soup(self.site)
|
soup = self.index_to_soup(self.site)
|
||||||
|
|
||||||
|
# First page has the ad, Let's find the redirect address.
|
||||||
|
url = soup.find('span', attrs={'class':'commonCopy'}).find('a').get('href')
|
||||||
|
if url.startswith('/'):
|
||||||
|
url = self.site + url
|
||||||
|
|
||||||
|
soup = self.index_to_soup(url)
|
||||||
|
|
||||||
# Searches the site for Issue ID link then returns the href address
|
# Searches the site for Issue ID link then returns the href address
|
||||||
# pointing to the latest issue
|
# pointing to the latest issue
|
||||||
latest_issue = soup.find('a', attrs={'href':lambda x: x and 'IssueID' in x}).get('href')
|
latest_issue = soup.find('a', attrs={'href':lambda x: x and 'IssueID' in x}).get('href')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user