Use Google Search special query terms in search()
masterYou can use several Google Search operators within the query parameter of search() to refine results:
- Boolean OR:
boeing OR airbus - Exclude term: Use
-before a word (e.g.,apple -fruit) - Include term: Use
+before a word (e.g.,+apple) - Phrase Search: Use double quotes (e.g.,
"Tokyo Olympics") - allintext:: Requires all words to be in the document body.
- intitle:: Restricts results to documents containing a word in the title.
- allintitle:: Restricts results to documents containing all query words in the title.
- inurl:: Restricts results to documents containing a word in the URL.
- allinurl:: Restricts results to documents containing all query words in the URL.
Note: Operators like as_*, allinlinks:, and related: are reported as not working with Google News.
from pygooglenews import GoogleNews
gn = GoogleNews()
s = gn.search('boeing OR airbus')