Question: We'll be usehttp://example.comfor this exercise. please use python Jupyter notebook to finsh this. 1. Use requests library to get the content of webpagehttp://example.com Use BeautifulSoup
We'll be usehttp://example.comfor this exercise. please use python Jupyter notebook to finsh this.
1. Use requests library to get the content of webpagehttp://example.com
- Use BeautifulSoup to parse the page content, name itpage1
- Display theportion of the content
- Print the first plain text you find on this page (the text of the firsttag)
- Find all the hyper links in the page and store them in a variable,page_links
2. Get the URL of the first link
- Follow this link to its webpage and use BeautifulSoup to parse its page content, name itpage2
- Display theof the content.
- Find out how many tables are in this page
.
- Writea program to extract the header and data entries in the first tableusing html tree relationship functions to find each item of the table:
store the result into a list of lists where
othe first list contains all the headers
oeach row of rest contains data from each row of the table
convert the list of lists into a Pandas dataframe, df, where column headers are the headers of the table
print out the dataframe, df
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved AnswerStep: 1 Unlock
Question Has Been Solved by an Expert!Get step-by-step solutions from verified subject matter experts
Step: 2 UnlockStep: 3 Unlock
