Ejemplo n.º 1
0
def _dict_to_question(d):
    question = Question()

    question.title = d['title']
    question.url = d['url']

    return question
Ejemplo n.º 2
0
def _to_question(question_element, story):
    question = Question()

    question.title = _question_title(question_element, story)
    question.url = _question_url(question_element)

    return question
Ejemplo n.º 3
0
def _dict_to_question(d):
    question = Question()

    question.title = d['title']
    question.url = d['url']

    return question
Ejemplo n.º 4
0
    def _to_question(question_element, story):
        question = Question()

        question.title = _question_title(question_element, story)
        question.url = _question_url(question_element)

        url_valid = ZhihuDailyOfficial._is_question_url_valid(question.url)

        return question if url_valid else None
Ejemplo n.º 5
0
def _to_question(question_element):
    question = Question()

    question_title_element = _get_question_title_element(question_element)
    if question_title_element:
        question.title = question_title_element.get_text()

    question.url = _get_question_url(question_element)

    return question