A Python package for searching in Google Search. This package provides the ability to search for images, videos, news, and specific file types.
To install the package, you can use pip:
pip install git+https://github.com/krishna2206/google-search-python
Here's how you can use the different search modules in this package:
from googlesearchpython import PageSearch
# Create a PageSearch object
page_search = PageSearch("query", page=1)
# Print the results
print(page_search.results)
from googlesearchpython.filesearch.filesearch import FileSearch
# Create a FileSearch object
file_search = FileSearch("query", "filetype", limit=10, page=1)
# Print the results
print(file_search.results)
Note: The "filetype" parameter should be one of the supported file types. Currently, the supported file types are "pdf", "doc", "docx", "xls", "xlsx", "ppt", and "pptx". Please check the constants.py
file for the most up-to-date list of supported file types.
from googlesearchpython import NewsSearch
# Create a NewsSearch object
news_search = NewsSearch("query", page=1)
# Print the results
print(news_search.results)
from googlesearchpython import ImageSearch
# Create an ImageSearch object
image_search = ImageSearch("query")
# Getting the next page of results
image_search.next_results()
image_search.next_results()
# Print the results
print(image_search.results)
This package depends on the following Python libraries:
- requests
- beautifulsoup4
- lxml
This project is licensed under the MIT License - see the LICENSE.md file for details.