xgoogle | Python library to Google services
kandi X-RAY | xgoogle Summary
kandi X-RAY | xgoogle Summary
Python library to Google services (google search, google sets, google translate, sponsored links)
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xgoogle
xgoogle Key Features
xgoogle Examples and Code Snippets
Community Discussions
Trending Discussions on xgoogle
QUESTION
I am currently trying to get a list of Google Search results via Python.
Many different package have stopped working or have been deprecated when google changed the html layout several years ago e.g. pygoogle, xgoogle
Searching for "Hiking Trails Los Angeles" on Google, how do I return the top 10 results, ideally with url, title and description or other attributes that are available?
...ANSWER
Answered 2017-Mar-09 at 07:41Yh, google-search-api has been deprecated, hence the pygoogle which was a wrapper for the Google search api. At the top of the search api page, there's a warning, along with:
We encourage you to investigate the Custom Search API, which may provide an alternative solution.
But using this custom search api to search the whole web isn't pretty straightforward. Here I found 2 detailed guides (SO answers):
- 1st step: get Google API key.
- 2nd step: setup Custom Search Engine so that you can search the entire web.
- 3rd step: install Google API client for Python.
- 4th step (bonus): do the search.
So, after setting this up, you can follow the code samples from few places:
Yes, Google Custom Search has now replaced the old Search API, but you can still use Google Custom Search to search the entire web, although the steps are not obvious from the Custom Search setup.
To create a Google Custom Search engine that searches the entire web:
- From the Google Custom Search homepage ( http://www.google.com/cse/ ), click Create a Custom Search Engine.
- Type a name and description for your search engine.
- Under Define your search engine, in the Sites to Search box, enter at least one valid URL (For now, just put www.anyurl.com to get past this screen. More on this later ).
- Select the CSE edition you want and accept the Terms of Service, then click Next. Select the layout option you want, and then click Next.
- Click any of the links under the Next steps section to navigate to your Control panel.
- In the left-hand menu, under Control Panel, click Basics.
- In the Search Preferences section, select Search the entire web but emphasize included sites.
- Click Save Changes.
- In the left-hand menu, under Control Panel, click Sites.
- Delete the site you entered during the initial setup process.
Google Custom Search is not free all the way i.e. Pricing:
- Custom Search Engine (free) For CSE users, the API provides 100 search queries per day for free. If you need more, you may sign up for billing in the API Console. Additional requests cost $5 per 1000 queries, up to 10k queries per day.
- Google Site Search (paid). For detailed information on GSS usage limits and quotas, please check GSS pricing options.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xgoogle
No Installation instructions are available at this moment for xgoogle.Refer to component home page for details.
Support
If you have any questions vist the community on GitHub, Stack Overflow.
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page