Navigate to the Cloud Reader library page.

    Raises:
      BrowserError: If the KCR homepage could not be loaded.
      ConnectionError: If there was a connection error.
515335
def _to_reader_home(self):
    
    # NOTE: Prevents QueryInterface error caused by getting a URL
    # while switched to an iframe
    self.switch_to_default_content()
    self.get(_KindleCloudReaderBrowser._CLOUD_READER_URL)

    if self.title == u'Problem loading page':
      raise ConnectionError

    # Wait for either the login page or the reader to load
    login_or_reader_loaded = lambda br: (
        br.find_elements_by_id('amzn_kcr') or
        br.find_elements_by_id('KindleLibraryIFrame'))
    self._wait(5).until(login_or_reader_loaded)

    try:
      self._wait(5).until(lambda br: br.title == u'Amazon.com Sign In')
    except TimeoutException:
      raise BrowserError('Failed to load Kindle Cloud Reader.')
    else:
      self._login()
84529
def load_page(page)
    return if Page.visited.include?(page)

    html = open("https://projecteuler.net/archives;page=#{page}")
    fragment = Nokogiri::HTML(html)

    problem_links = fragment.css('#problems_table td a')

    i = (page - 1) * Page::LENGTH + 1
    problem_links.each do |link|
      Problem[i].title = link.text
      i += 1
    end

    Page.visited << page
  end
1124361
function (books, context, options) {
      kb.fetcher.load(books).then(function (xhr) {
        renderThreeColumnBrowser2(books, context, options)
      }).catch(function (err) { complain(err) })
    }
536422
function navigateToUrl(page, ph, url, callback) {

    var oldUrl;
    async.waterfall([
        function (callback) {
            page.get('url', function (url) {
                oldUrl = url;
                callback();
            });
        },

        function (callback) {
            page.evaluate(function (url) {
                try {
                    window.location.href = url;
                } catch (exception) {
                    return exception;
                }
            }, function (error) {
                // do this because if there is no error, the error is still something so we can't simply do callback(error);
                if (error) {
                    callback(error);
                    return;
                }

                callback();
            }, url);
        },

        function (callback) {
            checks.pageHasChanged(page, oldUrl, function (error) {
                callback(error);
            });
        }
    ], function (error) {
        callback(error, page, ph);
    });
}
634161
def open(self):
        

        with open(self.path, 'r') as f:
            corrected = f.read().replace('rdf:resource rdf:resource',
                                         'link:link rdf:resource')
        with open(self.path, 'w') as f:
            f.write(corrected)

        super(ZoteroParser, self).open()
873210
def _get_search_result(self, query_url, **query_params):
        
        param_q = query_params.get('q')
        param_query = query_params.get('query')
        # Either q or query parameter is required
        if bool(param_q) == bool(param_query):
            raise CloudantArgumentError(104, query_params)

        # Validate query arguments and values
        for key, val in iteritems_(query_params):
            if key not in list(SEARCH_INDEX_ARGS.keys()):
                raise CloudantArgumentError(105, key)
            if not isinstance(val, SEARCH_INDEX_ARGS[key]):
                raise CloudantArgumentError(106, key, SEARCH_INDEX_ARGS[key])
        # Execute query search
        headers = {'Content-Type': 'application/json'}
        resp = self.r_session.post(
            query_url,
            headers=headers,
            data=json.dumps(query_params, cls=self.client.encoder)
        )
        resp.raise_for_status()
        return response_to_json_dict(resp)
1009988
def connect(self, **kwargs):
        
        self.app = self._app.connect(**kwargs)
        try:
            self._top_window = self.app.top_window().wrapper_object()
            self.set_foreground()
        except RuntimeError:
            self._top_window = None
624671
def _fetch(self):
        
        while True:
            url = self._to_fetch.get()
            try:
                if url:
                    page = self.get_page(url)
                    if page is None:    # e.g. after an error
                        continue
                    for link, rel in page.links:
                        if link not in self._seen:
                            try:
                                self._seen.add(link)
                                if (not self._process_download(link) and
                                    self._should_queue(link, url, rel)):
                                    logger.debug('Queueing %s from %s', link, url)
                                    self._to_fetch.put(link)
                            except MetadataInvalidError:  # e.g. invalid versions
                                pass
            except Exception as e:  # pragma: no cover
                self.errors.put(text_type(e))
            finally:
                # always do this, to avoid hangs :-)
                self._to_fetch.task_done()
            if not url:
                #logger.debug('Sentinel seen, quitting.')
                break
40025
private void navigateTo(String pageKey, String urlToOpen, String windowHandle) {
        Context.addWindow(pageKey, windowHandle);
        Context.setMainWindow(pageKey);
        Context.getDriver().navigate().to(urlToOpen);
    }
522129
def open(self, url):
        
        protocol, location = self.split(url)
        if protocol == self.protocol:
            return self.find(location)
        else:
            return None
1242805
def _connected(self, link_uri):
        
        print('Connected to %s' % link_uri)
        self._is_link_open = True
        self._connect_event.set()
1160122
def browse_website(self, browser=None):
        
        if len(self.all_versions):
            metadata = self.pypi.release_data(self.project_name, \
                    self.all_versions[0])
            self.logger.debug("DEBUG: browser: %s" % browser)
            if metadata.has_key("home_page"):
                self.logger.info("Launching browser: %s" \
                        % metadata["home_page"])
                if browser == 'konqueror':
                    browser = webbrowser.Konqueror()
                else:
                    browser = webbrowser.get()
                    browser.open(metadata["home_page"], 2)
                return 0

        self.logger.error("No homepage URL found.")
        return 1
958046
def browseMaps( self ):
        
        url    = self.urlTemplate()
        params = urllib.urlencode({self.urlQueryKey(): self.location()})
        
        url    = url % {'params': params}
        webbrowser.open(url)
508726
def connect(self):
        
        print('Connecting to %s' % self._link_uri)
        self._cf.open_link(self._link_uri)
1261332
async def _get_auth_page(self) -> str:
        
        # Prepare request
        params = {
            'client_id': self.app_id,
            'redirect_uri': 'https://oauth.vk.com/blank.html',
            'display': 'mobile',
            'response_type': 'token',
            'v': self.API_VERSION
        }
        if self.scope:
            params['scope'] = self.scope

        # Send request
        status, response = await self.driver.get_text(self.AUTH_URL, params)

        # Process response
        if status != 200:
            error_dict = json.loads(response)
            raise VkAuthError(error_dict['error'], error_dict['error_description'], self.AUTH_URL, params)
        return response
934375
def _raise_page_error(self):
        
        if hasattr(self, "title"):
            raise PageError(title=self.title)
        else:
            raise PageError(pageid=self.pageid)
168237
def page(self):
        
        if not self._page:
            try:
                self._page = self.paginator.page(
                    self.query_dict.get('page', 1))
            except InvalidPage:
                raise HttpError("Invalid page", status=HTTP_400_BAD_REQUEST)
        return self._page