55 dom = html.fromstring(resp.text)
57 for result
in eval_xpath_list(dom, results_xpath):
59 _text = extract_text(eval_xpath(result, premium_xpath))
60 if _text
and premium_keytext
in _text:
62 img_src = extract_text(eval_xpath(result, img_src_xpath))
64 img_src = img_src.split(
' ')[0]
65 parsed_url = urllib.parse.urlparse(img_src)
66 img_src = parsed_url._replace(path=parsed_url.path.split(
'/v1')[0]).geturl()
70 'template':
'images.html',
71 'url': extract_text(eval_xpath(result, url_xpath)),
73 'thumbnail_src': extract_text(eval_xpath(result, thumbnail_src_xpath)),
74 'title': extract_text(eval_xpath(result, title_xpath)),
78 nextpage_url = extract_text(eval_xpath(dom, cursor_xpath))
82 'engine_data': nextpage_url.replace(
"http://",
"https://"),