def process_POST_request(request):
dict_ = urlparse.parse_qs(request.text)
def htmlify(thing):
try:
html = dict_[thing][0]
except KeyError as e:
html = ''
return '<html>' + html + '</html>'
uri = dict_['uri'][0]
head = htmlify('head')
body = htmlify('body')
try:
text = dict_['data'][0]
except KeyError as e:
text = ''
headsoup = BeautifulSoup(head, 'lxml')
bodysoup = BeautifulSoup(body, 'lxml')
target_uri = getUri(uri, headsoup, bodysoup)
doi = getDoi(headsoup, bodysoup)
return target_uri, doi, head, body, text
评论列表
文章目录