Extract specific text from URL query parameters or scrape HTML content using urllib and BeautifulSoup.