Skip to content

5. Search delimiters

Javinator9889 edited this page Aug 13, 2018 · 10 revisions

While we are searching for content at Google, sometimes we delimit the results as we are looking for some specific content.

Here are included the delimiters, in particular about Google Search this time.

Google Search

  • withFileSearchByFileType(self, filetype: str): defines a file type so the results will have it. For example, you can ask pyGle to look for .pdf files.
  • withSiteSearch(self, site: str): defines a website for delimiting the results. You must include all the domain name, for example: google.com.
  • withRights(self, rights: Rights): the results content or data must have the specified Rights. You must create a Rights object.
  • withRelatedPagesToADocument(self, document_url: str): find only pages that are related to a document URL.
  • withLinkingToUrl(self, url: str): find only pages that links to the specified URL.
  • withDocumentCountry(self, country: Countries): find documents that are published at the specified Country.

List output format

Here is the format of the results, when job finishes:

[   {   
        'title': 'result title',
        'description': 'result description',
        'link': 'result URL',
        'cached_version': 'cached version URL',
        'date': 'result date'}, 
    {... MORE RESULTS ...},
    {
        'how_many_results': 'number of results',
        'related_search': ['related search', 'related search', ...],
        'google_stats': 'google provided stats',
        'stats': {
            'overall_time': 'searching time',
            'google_search_time': 'google searching time',
            'parsing_page_time': 'reading and extracting info time'
         },
         'url': 'used URL'
    }
]

Searching at a different Google Page

For searching at another Google Page, you must use the following method:

  • withSearchingAtDifferentGooglePages(self, google_pages: GooglePages): defines a GooglePage to search, different from a normal Google Search. You must create a GooglePages object.

<<< Previous page - Next page >>>