Google Search guide for developers - part 1
Tags: python, tutorial, productivity, devlife
Published: 2022-09-13 16:03:39

_Anyone who has been a developer for a day or for several years knows that a percentage of the job consists in finding solutions online, whether it is within FAQs, forums or online community platforms, or official documentation._

_A topic that is hardly covered during the programming courses is how to best use Google Search to quickly and punctually find what we need, so as not to waste time and precious attention._

Let's see a roundup of useful tips & tricks for developers of all kinds.

## Site statement

**The statement site allows you to limit the search to a specific domain or path within the content indexed by Google.**
For example, let's say that I want to see the contents that talk about the Python Pandas package but only within the Pypi.org domain.

I would search
[`pandas site: https://pypi.org/`](https://www.google.com/search?q=pandas+site%3A+https%3A+%2F%2Fpypi.org%2F&rlz=1C5GCEM_enIT1012IT1012&sourceid=chrome&ie=UTF-8)


![Search by site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s04gibx5wciclykvgxy2.png)

**Note that the address can be even more specific and include not only the top-level domain.** For example, I might want to search for the term setup within the official Python documentation limited to version 3.9.
I would search
[`setup site:https://docs.python.org/3.9/`](https://www.google.com/search?q=setup+site%3Ahttps%3A%2F%2Fdocs.python.org%2F3.9%2F&rlz=1C5GCEM_enIT1012IT1012&sourceid=chrome&ie=UTF-8)

Very useful use of the site statement is to do **a global search at the Google Drive or AWS S3 repository level** (of course, only for content whose security policy allows access to you and Google).

I would search
[`python site:s3.amazonaws.com filetype:pdf`](https://www.google.com/search?q=python+site%3As3.amazonaws.com+filetype%3Apdf)
Or
[`python site:drive.google.com`](https://www.google.com/search?q=python+site%3Adrive.google.com)

## Filetype
The second statement which si rarely used is the one that allows you to specify the type of file we are looking for. **Google Search is usually thought to only contain web pages, but that's not the case at all.**
For example, I might want to search only pdf files that pertain to ARIMA time series models on Python.
I would search
[`python time series arima filetype:pdf`](https://www.google.com/search?q=python+time+series+arima+filetype%3Apdf)

Or look for a Python script where the Chilkat package is used
[`"import chilkat" filetype:py`](https://www.google.com/search?q=%22import+chilkat%22+filetype%3Apy)

An incomplete list of file types supported by Google Search is as follows:

- Adobe Portable Document Format (_.pdf_)
- Adobe PostScript (_.ps_)
- Autodesk Design Web Format (_.dwf_)
- Google Earth (_.kml, .kmz_)
- GPS eXchange Format (_.gpx_)
- Hancom Hanword (_.hwp_)
- HTML (_.htm, .html,_ other file extensions)
- Microsoft Excel (_.xls, .xlsx_)
- Microsoft PowerPoint (_.ppt, .pptx_)
- Microsoft Word (_.doc, .docx_)
- OpenOffice presentation (_.odp_)
- OpenOffice spreadsheet (_.ods_)
- OpenOffice text (_.odt_)
- Rich Text Format (_.rtf_)
- Scalable Vector Graphics (_.svg_)
- TeX/LaTeX (_.tex_)
- Text (_.txt, .text_, other file extensions)

Common programming languages:
**- Basic source code (_.bas_)**
**- C/C++ source code (_.c, .cc, .cpp, .cxx, .h, .hpp_)**
**- C# source code (_.cs_)**
**- Java source code (_.java_)**
**- Perl source code (_.pl_)**
**- Python source code (_.py_)**
**- Wireless Markup Language (_.wml, .wap_)**
**- XML (_.xml_)**

## Exact match
**To search for an exact phrase (therefore the union of several words) it is preferable to insert the text between double quotes.**
For example, I might want to search for exactly the following text generated by an error in compiling a script

> Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

I would search
[`"Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed."`](https://www.google.com/search?q=%22Importing+the+numpy+C-extensions+failed.+This+error+can+happen+for+many+reasons%2C+often+due+to+issues+with+your+setup+or+how+NumPy+was+installed.%22&rlz=1C5GCEM_enIT1012IT1012&oq=%22Importing+the+numpy+C-extensions+failed.+This+error+can+happen+for+many+reasons%2C+often+due+to+issues+with+your+setup+or+how+NumPy+was+installed.%22)

The official Google Search documentation does not place a limit on the length or composition of the sentence but, from my experience, I can tell you that I do not recommend using parts of the text that include carriage returns (which may have been typed in various ways on various contents online) and, above all, not to exceed 100 characters of text per single quoted string, as beyond this value it seems to me that there is a significant improvement in performance in terms of quantity and quality of results.

## Combined conditions: AND
**You can combine AND conditions together simply by writing the words in the field.**
For example, if I want to search for results that contain all three of the following words:

- Python
- Try
- Except
- telepot

It will be enough to write
[`Python Try Except telepot`](https://www.google.com/search?q=Python+Try+Except+telepot)
In some cases, especially if the number of words is large, it could be that Google shows us the results that contain most of the words we have indicated and not all. **We can avoid this behavior by pointing in double quotes the most important words for our search**, for example
[`Python "Try" "Except" telepot`](https://www.google.com/search?q=Python+%22Try%22+%22Except%22+telepot)


## Combined conditions: OR
**To combine multiple OR conditions it is important to write the conditions interspersed with the OR word** (written in capital letters). I can combine AND and OR conditions together, for example with the following statements
[scikit learn "random forest" OR "logistic regression"](https://www.google.com/search?q=scikit+learn+%22random+forest%22+OR+%22logistic+regression%22)
The results they contain will be shown
scikit learn _AND_ "random forest" _OR_ scikit learn _AND_ "logistic regression"


## Combined conditions: NOT
**To exclude a word or condition from the search it is sufficient to indicate the minus symbol "-" before the condition itself.**
For example, if I wanted to see the results that talk about time series forecast in Python, but not those that include the Prophet library I could indicate
[`time series forecasting python - "prophet"`](https://www.google.com/search?q=time+series+forecasting+python+-%22prophet%22)


## Put all toghether
All that has been seen so far can be combined according to the needs of our search.
For example, if we wanted to search for all sites that link to stackoverflow.com I would search
[`“Stackoverflow.com” -site: stackoverflow.com`](https://www.google.com/search?q=%E2%80%9CStackoverflow.com%E2%80%9D+-site%3Astackoverflow.com)

I believe that there are further techniques to fill in at least a couple of other articles like this one so if you liked it and want a second and third part, **let me know by sharing the article with your network and showing appreciation here on Dev.to.

**Finally, please get in touch with me on my [personal website](https://www.simboli.eu).**