Nv7-GitHub / googlesearch

A Python library for scraping the Google search engine.
https://pypi.org/project/googlesearch-python/
MIT License
480 stars 117 forks source link

Add Safe Search #76

Closed VincentX0905 closed 5 months ago

VincentX0905 commented 7 months ago

If you want to turn off the safe search function (this function is on by default), you can do this:

from googlesearch import search
search("Google", safe=None) #turn off safe search

If you don't give a safe value, the default is on:

from googlesearch import search
search("Google") #turn on safe search
VincentX0905 commented 7 months ago

before merging You can run pip install -U git+https://github.com/VincentX0905/googlesearch.git to install the package with safe search option.

VincentX0905 commented 7 months ago

If you include &safe="active" in the URL SafeSearch mode will be turned on

If &safe=off is included in the URL or not specified SafeSearch mode will be turned off

Google is committed to creating a safe browsing environment For this reason, I set this feature to be on by default.