Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def selector(self):
if self._selector is None:
self._selector = Selector(text=self._response.text)
return self._selector
def selector(self) -> parsel.Selector:
from parsel.selector import Selector
if self._cached_selector is None:
self._cached_selector = Selector(self.html)
return self._cached_selector
def selector(self):
"""Returns the current state of the browser in a Selector
We re-parse the site on each xpath, css, re call because we are running a web browser
and the site may change between calls"""
return Selector(text=self.page_source)