Created
July 22, 2019 20:32
-
-
Save nicksyna01/2c5bea39fcc07e1e254c5f5a8323eeed to your computer and use it in GitHub Desktop.
Using Google Search Function Using Python To Search For a Term and Showing the Top Results for it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from googlesearch import search | |
| import urllib.request as ur | |
| from bs4 import BeautifulSoup | |
| try: | |
| from googlesearch import search | |
| except ImportError: | |
| print("No module named 'google' found") | |
| # to search | |
| query = "G20 Summit" | |
| for j in search(query, tld="co.in", num=10, stop=1, pause=2): | |
| print(j) | |
| #html = ur.urlopen(j).read() | |
| #print(html) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above code gave links presented below:
https://g20.org/en/summit/about/
https://g20.org/en/
https://www.japan.go.jp/g20japan/
https://en.wikipedia.org/wiki/2019_G20_Osaka_summit
https://en.wikipedia.org/wiki/2019_G20_Osaka_summit#Participating_leaders
https://en.wikipedia.org/wiki/2019_G20_Osaka_summit#Invited_guests
https://en.wikipedia.org/wiki/2019_G20_Osaka_summit#International_organization_guests
https://en.wikipedia.org/wiki/2019_G20_Osaka_summit#Issues
https://en.wikipedia.org/wiki/List_of_G20_summits
https://en.wikipedia.org/wiki/List_of_G20_summits#Summits_of_state_leaders
https://en.wikipedia.org/wiki/List_of_G20_summits#Ministerial-level_meetings
https://en.wikipedia.org/wiki/List_of_G20_summits#B20_summits
https://www.youtube.com/watch?v=Qrvf220efSk
https://www.consilium.europa.eu/en/meetings/international-summit/2019/06/28-29/
https://www.bbc.com/news/world-48810070
https://www.aljazeera.com/news/2019/06/g20-summit-2019-latest-updates-190624071602768.html
https://www.livemint.com/news/world/india-boycotts-osaka-track-at-g20-summit-1561897592466.html