import requests from bs4 import BeautifulSoup This is a conceptual example – real use needs API or scraping with caution. query = "site:pastebin.com dxc" Use Google Custom Search JSON API or a paid SERP API. Never scrape Google directly without permission – violates ToS.