html - building an outline from a webpage,python -
I am trying to create a function which is to open a URL and create an outline with the HTML code. The framework should include any ... Text between the tags. Just to create an outline from a specific web page Each top level should also be numbered properly, which will have X levels of numbering at the top of Hx. how to start?
html
has a lot of tags in titles
Apart from the link it is to get you started:
You need the Sundersoop 4
package and the request for this
is requested. Python comes with inbuilt packages for these options, although the above 2 packages make the job very easy.
Import BS 4 Import from imported requests BeautifulSoup html = requests.get ("http: //homepage.cs .uiowa.edu/~illillis/166/summer/submission/HW12/Jazz .html "). Text # If you want to parse another url then get () soup = beautiful soup (html, "lxml") print Soup.body
this tag <
Comment below, I will change the code html
if you want a separate output or something more specific then you will print other content within the code / code>, texts
and body
Comments
Post a Comment