its contents but when it names cgi scriptthe effect is to run the remote script and fetch its output this notion opens the door to web serviceswhich generate useful xml in response to input parametersin simpler rolesthis allows us to test remote scripts for examplewe can trigger the script in example - directlywithout either going through the tutor html web page or typing url in browser' address fieldc:\pp \internet\webpython from urllib request import urlopen reply urlopen(reply 'tutor py\ngreetings\ \nhellobrian \ \nprint(reply decode()tutor py greetings hellobrian url conn urlopen(urlreply conn read(print(reply decode()tutor py greetings who are yourecall from that urllib request urlopen gives us file object connected to the generated reply stream reading this file' output returns the html that would normally be intercepted by web browser and rendered into reply page the reply comes off of the underlying socket as bytes in xbut can be decoded to str strings as needed when fetched directly this waythe html reply can be parsed with python text processing toolsincluding string methods like split and findthe re pattern-matching moduleor the html parser html parsing module--all tools we'll explore in extracting text from the reply like this is sometimes informally called screen scraping-- way to use website content in other programs screen scraping is an alternative to more complex web services frameworksthough brittle onesmall changes in the page' format can often break scrapers that rely on it the reply text can also be simply inspected--urllib request allows us to test cgi scripts from the python interactive prompt or other scriptsinstead of browser more generallythis technique allows us to use server-side script as sort of function call for instancea client-side gui can call the cgi script and parse the generated reply page similarlya cgi script that updates database may be invoked programmatically with urllib requestoutside the context of an input form page this also opens the server-side scripting