Question: using python 3 For this assignment you will write a function that takes two arguments: a URL for a web page and a file name
using python 3
For this assignment you will write a function that takes two arguments: a URL for a web page and a file name for the output. The function is to open the URL and construct an outline from the HTML code. The outline is to be saved in a text file with the specified name. The outline should include text between any
, , , , , or tags. The text from each heading level should be indented properly so that all tags are indented under their tag, etc. Each heading level should also be properly numbered, with heading hx having x levels of numbering.
, , , or tags. The text from each heading level should be indented properly so that all tags are indented under their tag, etc. Each heading level should also be properly numbered, with heading hx having x levels of numbering.
, or tags. The text from each heading level should be indented properly so that all tags are indented under their tag, etc. Each heading level should also be properly numbered, with heading hx having x levels of numbering.
tags are indented under their tag, etc. Each heading level should also be properly numbered, with heading hx having x levels of numbering.
Assumptions
You can make the following assumptions regarding the HTML code being used to construct the outline:
1 The
2 The x> end tag always appears with no white space.
3 The heading levels always increase and decrease by at most one.
Example:
The outline constructed from the web page http://homepage.divms.uiowa.edu/~lillis/016/2018Summer/jazz.html should be as shown below.
1 Jazz 1.1 Definitions 1.1.1 Importance of improvisation 1.1.2 Debates 1.2 Etymology 1.3 Race 1.4 History 1.4.1 Origins 1.4.1.1 Blended African and European music sensibilities 1.4.1.1.1 Slave gatherings 1.4.1.1.2 The Black church 1.4.1.1.3 Minstrel and salon music 1.4.1.1.4 African rhythmic retention 1.4.1.2 "Spanish tinge"-the Afro-Cuban rhythmic influence 1.4.2 1890s - 1910s 1.4.2.1 Ragtime 1.4.2.2 Blues 1.4.2.2.1 African genesis 1.4.2.2.2 W.C. Handy: early published blues 1.4.2.2.3 Within the context of Western harmony 1.4.2.3 New Orleans 1.4.2.3.1 Syncopation 1.4.2.3.2 Swing 1.4.2.4 Other regions 1.4.3 1920s and 1930s 1.4.3.1 The Jazz Age 1.4.3.2 Swing 1.4.3.3 Beginnings of European jazz 1.4.4 1940s and 1950s 1.4.4.1 "American music"the influence of Ellington 1.4.4.2 Bebop 1.4.4.2.1 Rhythm 1.4.4.2.2 Harmony 1.4.4.3 Afro-Cuban jazz (cu-bop) 1.4.4.3.1 Machito and Mario Bauza 1.4.4.3.2 Dizzy Gillespie and Chano Pozo 1.4.4.3.3 African cross-rhythm 1.4.4.4 Dixieland revival 1.4.4.5 Cool jazz 1.4.4.6 Hard bop 1.4.4.7 Modal jazz 1.4.4.8 Free jazz 1.4.5 1960s and 1970s 1.4.5.1 Latin jazz 1.4.5.1.1 Afro-Cuban jazz 1.4.5.1.1.1 Guajeos 1.4.5.1.1.2 Afro-Cuban jazz renaissance 1.4.5.1.2 Afro-Brazilian jazz 1.4.5.2 Post-bop 1.4.5.3 Soul jazz 1.4.5.4 African inspired 1.4.5.4.1 Themes 1.4.5.4.2 Rhythm 1.4.5.4.3 Pentatonic scales 1.4.5.5 Jazz fusion 1.4.5.5.1 Miles Davis' new directions 1.4.5.5.2 Psychedelic-jazz 1.4.5.5.2.1 Bitches Brew 1.4.5.5.2.2 Herbie Hancock 1.4.5.5.2.3 Weather Report 1.4.5.5.3 Jazz-rock 1.4.5.5.4 Jazz-funk 1.4.5.6 Other trends 1.4.6 1980s 1.4.6.1 Resurgence of Traditionalism 1.4.6.2 Smooth jazz 1.4.6.3 Acid jazz, nu jazz and jazz rap 1.4.6.4 Punk jazz and jazzcore 1.4.6.5 M-Base 1.4.7 1990s - 2010s 1.5 See also 1.6 References 1.7 Further reading 1.8 External links
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
