[Apec][Adecco]use html2text to fill description content
This commit is contained in:
parent
3023787214
commit
06310579d6
2 changed files with 6 additions and 2 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
from weboob.tools.misc import html2text
|
||||||
from .job import AdeccoJobAdvert
|
from .job import AdeccoJobAdvert
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
import re
|
||||||
|
|
@ -84,5 +85,6 @@ class AdvertPage(BasePage):
|
||||||
advert.pay = u'%s' % spans[2].text
|
advert.pay = u'%s' % spans[2].text
|
||||||
advert.contract_type = u'%s' % spans[3].text
|
advert.contract_type = u'%s' % spans[3].text
|
||||||
advert.url = url
|
advert.url = url
|
||||||
advert.description = self.document.getroot().xpath("//div[@class='descriptionContainer']/p")[0].text_content()
|
description = self.document.getroot().xpath("//div[@class='descriptionContainer']/p")[0]
|
||||||
|
advert.description = html2text(self.parser.tostring(description))
|
||||||
return advert
|
return advert
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
from weboob.tools.misc import html2text
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
@ -52,7 +53,8 @@ class AdvertPage(BasePage):
|
||||||
advert = ApecJobAdvert(_id)
|
advert = ApecJobAdvert(_id)
|
||||||
advert.title = re_id_title.search(url).group(2).replace('-', ' ')
|
advert.title = re_id_title.search(url).group(2).replace('-', ' ')
|
||||||
|
|
||||||
advert.description = self.document.getroot().xpath("//div[@class='contentWithDashedBorderTop marginTop boxContent']/div")[0].text_content()
|
description = self.document.getroot().xpath("//div[@class='contentWithDashedBorderTop marginTop boxContent']/div")[0]
|
||||||
|
advert.description = html2text(self.parser.tostring(description))
|
||||||
|
|
||||||
advert.job_name = advert.title
|
advert.job_name = advert.title
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue