Web scraping with Python
Let's start a new Python notebook by going to File and selecting New Jupyter Notebook. We can assign it the following name: PercentBikeRiders by Country. We will scrape a table from the following Wikipedia website: https://github.com/asherif844/PracticalBusinessIntelligence/wiki/AdventureWorks---Detail-by-CountryCode.
This table lists country codes with the percentage of bicycle riders, as seen in the following screenshot:
In our new notebook, our first lines of code will import all of the required modules that we just finished installing, as seen in the following script:
#import packages into the project from bs4 import BeautifulSoup from urllib.request import urlopen import pandas as pd
Once those have been imported, click on the play symbol button on the toolbar to execute the code inside of the cells.
At this point, you can continue to work inside of PyCharm directly, or you can copy the server IP address (http://127.0.0.1:8888
) that pops...