def get(self, url, timeout=None, headers=None, params=None, cache_ext=None):
if headers is None:<EOL><INDENT>headers = {}<EOL><DEDENT>cached = cache_info = None<EOL>if self.cache:<EOL><INDENT>cached, cache_info = self.cache.get(url)<EOL><DEDENT>if cache_ext:<EOL><INDENT>if not cache_info:<EOL><INDENT>cache_info = cache_ext<EOL><DEDENT>if cache_info.access_time and cache_ext.access_time:<EOL><INDENT>if cache_info.access_time < cache_ext.access_time:<EOL><INDENT>cached = None<EOL>cache_info = cache_ext<EOL><DEDENT><DEDENT>if cache_info.etag != cache_ext.etag:<EOL><INDENT>cached = None<EOL>cache_info = cache_ext<EOL><DEDENT><DEDENT>if cached:<EOL><INDENT>return Response(cached, cache_info)<EOL><DEDENT>if not self.session:<EOL><INDENT>self._browser_init()<EOL><DEDENT>if self.cache:<EOL><INDENT>headers = self.cache.prepare_headers(headers, cache_info)<EOL><DEDENT>response = self._get(<EOL>url,<EOL>timeout=timeout,<EOL>headers=headers,<EOL>params=params<EOL>)<EOL>if "<STR_LIT>" in response.headers:<EOL><INDENT>if not cache_info:<EOL><INDENT>cache_info = CacheInfo()<EOL><DEDENT>cache_info.etag = response.headers.get('<STR_LIT>')<EOL><DEDENT>res = Response(cache_info=cache_info)<EOL>if response.history:<EOL><INDENT>code = <NUM_LIT:0><EOL>for resp in response.history + [None]:<EOL><INDENT>if resp is None:<EOL><INDENT>resp = response<EOL><DEDENT>if code in [<EOL>requests.codes.FOUND,<EOL>requests.codes.SEE_OTHER,<EOL>requests.codes.TEMPORARY_REDIRECT<EOL>]:<EOL><INDENT>self.info("<STR_LIT>".format(resp.url))<EOL><DEDENT>elif code in [<EOL>requests.codes.MOVED_PERMANENTLY,<EOL>requests.codes.PERMANENT_REDIRECT<EOL>]:<EOL><INDENT>self.warning("<STR_LIT>".format(resp.url))<EOL><DEDENT>elif code != <NUM_LIT:0>:<EOL><INDENT>self.error("<STR_LIT>".format(code, resp.url))<EOL><DEDENT>code = resp.status_code<EOL><DEDENT><DEDENT>if response.status_code == requests.codes.NOT_MODIFIED:<EOL><INDENT>self.info("<STR_LIT>".format(url))<EOL>res.html, _ = self.cache.get(url, ignore_access_time=True)<EOL>if self.cache:<EOL><INDENT>self.cache.update(url, cache_info)<EOL><DEDENT>return res<EOL><DEDENT>try:<EOL><INDENT>response.raise_for_status()<EOL><DEDENT>except HTTPError as e:<EOL><INDENT>raise WEBConnectException("<STR_LIT>".format(e, url))<EOL><DEDENT>try:<EOL><INDENT>raw = response.content<EOL>html = response.text<EOL>if raw is None:<EOL><INDENT>self.warning("<STR_LIT>")<EOL>raise Exception()<EOL><DEDENT>if html is None:<EOL><INDENT>self.warning("<STR_LIT>")<EOL>raise Exception()<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>raise WEBConnectException("<STR_LIT>".format(url))<EOL><DEDENT>if self.cache:<EOL><INDENT>self.cache.put(url, html, cache_info)<EOL><DEDENT>if url != response.url:<EOL><INDENT>if not response.history:<EOL><INDENT>self.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(url, response.url)<EOL>)<EOL><DEDENT>if self.cache:<EOL><INDENT>self.cache.put(response.url, html, cache_info)<EOL><DEDENT><DEDENT>res.html = html<EOL>res.raw = raw<EOL>return res<EOL>
Make get request to url (might use cache)

:param url: Url to make request to
:type url: str | unicode
:param timeout: Timeout for request (default: None)
    None -> infinite timeout
:type timeout: None | int | float
:param headers: Headers to be passed along (default: None)
:type headers: None | dict
:param params: Parameters to be passed along with url (default: None)
:type params: None | dict
:param cache_ext: External cache info
:type cache_ext: floscraper.models.CacheInfo
:return: Response
:rtype: floscraper.models.Response | None
:raises WEBConnectException: Loading failed