first matched element in spanelem passing the attribute name 'idto get(returns the attribute' value'authorprojectopening all search results whenever search topic on googlei don' look at just one search result at time by middle-clicking search result link (or clicking while holding ctrl) open the first several links in bunch of new tabs to read later search google often enough that this workflow--opening my browsersearching for topicand middle-clicking several links one by one--is tedious it would be nice if could simply type search term on the command line and have my computer automatically open browser with all the top search results in new tabs let' write script to do this with the search results page for the python package index at and duckduckgo often employ measures that make scraping their search results pages difficult this is what your program does gets search keywords from the command line arguments retrieves the search results page opens browser tab for each result this means your code will need to do the following read the command line arguments from sys argv fetch the search result page with the requests module find the links to each search result call the webbrowser open(function to open the web browser open new file editor tab and save it as searchpypi py step get the command line arguments and request the search page before coding anythingyou first need to know the url of the search result page by looking at the browser' address bar after doing searchyou can see that the result page has url like _term_herethe requests module can download this page and then you can use beautiful soup to find the search result links in the html finallyyou'll use the webbrowser module to open those links in browser tabs make your code look like the following#python searchpypi py opens several search results import requestssyswebbrowserbs web scraping