the bs beautifulsoup(function needs to be called with string containing the html it will parse the bs beautifulsoup(function returns beautifulsoup object enter the following into the interactive shell while your computer is connected to the internetimport requestsbs res requests get(res raise_for_status(nostarchsoup bs beautifulsoup(res text'html parser'type(nostarchsoupthis code uses requests get(to download the main page from the no starch press website and then passes the text attribute of the response to bs beautifulsoup(the beautifulsoup object that it returns is stored in variable named nostarchsoup you can also load an html file from your hard drive by passing file object to bs beautifulsoup(along with second argument that tells beautiful soup which parser to use to analyze the html enter the following into the interactive shell (after making sure the example html file is in the working directory)examplefile open('example html'examplesoup bs beautifulsoup(examplefile'html parser'type(examplesoupthe 'html parserparser used here comes with python howeveryou can use the faster 'lxmlparser if you install the third-party lxml module follow the instructions in appendix to install this module by running pip install --user lxml forgetting to include this second argument will result in userwarningno parser was explicitly specified warning once you have beautifulsoup objectyou can use its methods to locate specific parts of an html document finding an element with the select(method you can retrieve web page element from beautifulsoup object by calling the select()method and passing string of css selector for the element you are looking for selectors are like regular expressionsthey specify pattern to look for--in this casein html pages instead of general text strings full discussion of css selector syntax is beyond the scope of this book (there' good selector tutorial in the resources at /automatestuff /)but here' short introduction to selectors table - shows examples of the most common css selector patterns