Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- from xgoogle.search import GoogleSearch, SearchError
- try:
- gs = GoogleSearch("search query")
- gs.results_per_page = 50
- results = gs.get_results()
- for res in results:
- print res.title.encode("utf8")
- print res.url.encode("utf8")
- print
- except SearchError, e:
- print "Search failed: %s" % e
- {title1:url1, title50,url50}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement