49 if resp.status_code == 404:
52 raise_for_httperror(resp)
54 dom = html.fromstring(resp.text)
56 number_of_results_element = eval_xpath_getindex(
57 dom,
'//a[@class="active" and contains(@href,"/suchen/dudenonline")]/span/text()', 0, default=
None
59 if number_of_results_element
is not None:
60 number_of_results_string = re.sub(
'[^0-9]',
'', number_of_results_element)
61 results.append({
'number_of_results': int(number_of_results_string)})
63 for result
in eval_xpath_list(dom,
'//section[not(contains(@class, "essay"))]'):
64 url = eval_xpath_getindex(result,
'.//h2/a', 0).get(
'href')
65 url = urljoin(base_url, url)
66 title = eval_xpath(result,
'string(.//h2/a)').strip()
67 content = extract_text(eval_xpath(result,
'.//p'))
69 results.append({
'url': url,
'title': title,
'content': content})