Fetch and return a single page.
517556
def load_page(page_num)
      params = @query.merge(pagination_params(page_num))
      response = @client.api_request(:get, @path, :params => params)

      metadata = parse_metadata(response)
      @num_records, @num_pages = metadata['records'], metadata['pages']

      Page.new(@resource_class, response.parsed, metadata['links'])
    end
1226124
def fetch_pages(url, referer = nil, depth = nil, user_data = nil)
      url = URI(url)
      pages = []
      get(url, referer) do |response, code, location, redirect_to, response_time|
        handle_compression response
        page = Page.new(location, body: response.body,
                                  code: code,
                                  headers: response.to_hash,
                                  referer: referer,
                                  depth: depth,
                                  redirect_to: redirect_to,
                                  response_time: response_time,
                                  fetched_at: Time.now.to_i)
        page.user_data = user_data unless user_data.nil?
        pages << page
      end
      pages
    rescue *RESCUABLE_ERRORS => e
      if verbose?
        puts e.inspect
        puts e.backtrace
      end
      page = Page.new(url, error: e, referer: referer, depth: depth)
      page.user_data = user_data unless user_data.nil?
      [page]
    end
1144356
def fetch_archive(savedir, url, fname, force=False):
    """"""
    dest = pjoin(savedir, fname)
    if os.path.exists(dest) and not force:
        info("already have %s" % fname)
        return dest
    info("fetching %s into %s" % (url, savedir))
    if not os.path.exists(savedir):
        os.makedirs(savedir)
    req = urlopen(url)
    with open(dest, 'wb') as f:
        f.write(req.read())
    return dest
715411
def fetch_page_async(self, page_size, **q_options):
    
    qry = self._fix_namespace()
    return qry._fetch_page_async(page_size, **q_options)
881653
def fetch(self):
        
        response = self._session.get(self.url, params=self.params)
        response.raise_for_status()
        return response
586491
def get(path, params = {})
      uri = path
      if params.count > 0
        uri += "?#{URI.encode_www_form(params)}"
      end

      headers = {}

      request('GET', uri, nil, headers) do |resp|
        if params[:fetch_all] == true &&
            resp.body.has_key?('pagination') &&
            resp.body['pagination']['next_uri'] != nil
          params[:starting_after] = resp.body['data'].last['id']
          get(path, params) do |page|
            body = resp.body
            body['data'] += page.data
            resp.body = body
            yield(resp) if block_given?
          end
        else
          yield(resp) if block_given?
        end
      end
    end
33084
def get(self, request):
        
        sections_list = self.generate_sections()

        p = Paginator(sections_list, 25)

        page = request.GET.get('page')

        try:
            sections = p.page(page)
        except PageNotAnInteger:
            # If page is not an integer, deliver first page.
            sections = p.page(1)
        except EmptyPage:
            # If page is out of range (e.g. 9999), return last page of results.
            sections = p.page(p.num_pages)

        context = {
            'sections': sections,
            'page_title': self.generate_page_title(),
            'browse_type': self.browse_type
        }

        return render(
            request,
            self.template_path,
            context
        )
816297
def prev(self, error_out=False):
        """"""
        return self.query.paginate(self.page - 1, self.per_page, error_out)
1269243
def get(self, request, *args, **kwargs):
        
        response = super().get(request, args, kwargs)
        try:
            response.render()
        except Http404:
            request.GET = request.GET.copy()
            request.GET['page'] = '1'
            response = super().get(request, args, kwargs)
            response.status_code = 404

        return response
1331528
def get_page(self, url):
        
        if url:
            data = self.feed._request(url, offset=self._offset, since=self._since, before=self._before)

            # set values to False to avoid using them for next request
            self._before = False if self._before is not None else None
            self._since = False if self._since is not None else None
            if getattr(self.feed, 'issue65', False):
                self._offset = False
            if self._since is not None:
                # we want oldest items first when using 'since'
                return reversed(data['items'])
            else:
                return data['items']
        else:
            return []
514280
def fetchone(self):
        """"""
        self._check_executed()
        if self._rows is None or self.rownumber >= len(self._rows):
            return None
        result = self._rows[self.rownumber]
        self.rownumber += 1
        return result
46608
def Get_Page(self):
		'''
			
		'''
		url = 'http://www.gati.com/webservices/gatiicedkttrack.jsp?dktno=' + self.tracking_no
		response = requests.get(url)

		self.page = response.text
247041
def document(self):
        """"""
        resp = request.environ.get('pylons.original_response')
        page = error_document_template % \
            dict(prefix=request.environ.get('SCRIPT_NAME', ''),
                 code=request.params.get('code', resp.status_int),
                 message=request.params.get('message', resp.body))
        return page
710150
async def bounded_fetch(session, url):
    
    async with sem, session.get(url) as response:
        return await response.json()
525519
def _retrieve_page(self, page_index):
        """"""

        params = self._get_params()
        params["page"] = str(page_index)
        doc = self._request(self._ws_prefix + ".search", True, params)

        return doc.getElementsByTagName(self._ws_prefix + "matches")[0]
490144
def stream(self, page, limit=None, page_limit=None):
        
        current_record = 1
        current_page = 1

        while page is not None:
            for record in page:
                yield record
                current_record += 1
                if limit and limit is not values.unset and limit < current_record:
                    return

            if page_limit and page_limit is not values.unset and page_limit < current_page:
                return

            page = page.next_page()
            current_page += 1
694619
def fetch_result(self):
        """"""
        results = self.soup.find_all('div', {'class': 'container container-small'})
        href = None
        is_match = False

        i = 0
        while i < len(results) and not is_match:
            result = results[i]
            anchor = result.find('a', {'rel': 'bookmark'})
            is_match = self._filter_results(result, anchor)
            href = anchor['href']

            i += 1

        try:
            page = get_soup(href)
        except (Exception):
            page = None

        # Return page if search is successful
        if href and page:
            return page
        else:
            raise PageNotFoundError(PAGE_ERROR)